package com.aspose.cells;

import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Iterator;

public class Shape {
   zmk f;
   zpq g = null;
   String h = null;
   String i = null;
   ShapeCollection j;
   zbnw k;
   zanr l;
   int m;
   Object n;
   String o = null;
   zrt p;
   private String a;
   private FillFormat b;
   private MsoFormatPicture c;
   boolean q;
   private com.aspose.cells.b.a.b.zq d;
   boolean r = false;
   boolean s = false;
   boolean t = false;
   protected byte[] u;
   byte[] v;
   zbtz w;
   private String e = null;
   zpf x = null;
   private Geometry A;
   private short B;
   String y;
   boolean z;

   String v() {
      return this.h == null && this.O() != null ? this.O().a(this.L()) : this.h;
   }

   void d(String var1) {
      this.h = var1;
   }

   int w() {
      return this.k.i().b();
   }

   Shape(ShapeCollection shapes, int type, Object shapeParent) {
      this.j = shapes;
      this.l = new zanr(type);
      this.k = new zbnw(this, this.j.c());
      this.n = shapeParent;
      this.m = 0;
      this.a();
      if (this.L().n().k() && !this.a(type)) {
         this.p = new zrt(this.getAutoShapeType());
      }

   }

   private boolean a(int var1) {
      return var1 == 8 || var1 == 24 || var1 == 12 || var1 == 11;
   }

   Shape(ShapeCollection shapes, int msoDrawingType, int type, Object shapeParent) {
      this.j = shapes;
      if ((msoDrawingType == 29 || msoDrawingType == 30) && type != 4095) {
         msoDrawingType = ShapeCollection.a(type);
      }

      this.l = new zanr(msoDrawingType);
      this.k = new zbnw(this, this.j.c());
      this.n = shapeParent;
      this.m = 0;
      if (msoDrawingType != 30) {
         this.a();
      } else {
         this.N().i().a((short)type);
         this.N().c().a(191, 0, 524296);
         this.N().c().a(385, 0, 134217793);
         this.N().c().a(448, 0, 134217792);
         switch(type) {
         case 32:
            this.N().i().d(true);
            this.N().c().a(771, 0, 0);
            break;
         case 33:
         case 35:
         case 36:
            this.N().c().a(771, 0, 1);
         case 34:
         default:
            break;
         case 37:
         case 38:
         case 39:
         case 40:
            this.N().c().a(771, 0, 2);
         }
      }

      if (this.L().n().k() && !this.a(msoDrawingType)) {
         this.p = new zrt(this.getAutoShapeType());
      }

   }

   public int getZOrderPosition() {
      return this.x();
   }

   public void setZOrderPosition(int value) {
      int var2 = this.x();
      if (var2 != value) {
         Shape var3;
         if (value < var2) {
            var3 = this.j.get(var2);
            this.j.d(var2);
            this.j.a(value, var3);
         } else {
            var3 = this.j.get(var2);
            this.j.d(var2);
            this.j.a(value, var3);
         }

      }
   }

   int x() {
      if (this.j == null) {
         return 0;
      } else {
         for(int var1 = 0; var1 < this.j.getCount(); ++var1) {
            if (this.j.get(var1) == this) {
               return var1;
            }
         }

         return -1;
      }
   }

   private void a() {
      boolean var1 = this.L().n().k();
      switch(this.getMsoDrawingType()) {
      case 0:
         this.N().i().a(0);
         this.N().i().a(true);
         this.N().c().a(127, 0, 262148);
         break;
      case 1:
         this.N().i().a(20);
         this.N().c().a(191, 0, 524296);
         this.N().c().a(324, 0, 4);
         this.N().c().a(383, 0, 65536);
         this.N().c().a(447, 0, 1048576);
         this.N().c().a(448, 0, 134217792);
         this.N().c().a(511, 0, 1048592);
         break;
      case 2:
         this.N().i().a(1);
         this.N().c().a(191, 0, 524296);
         this.N().c().a(385, 0, 134217793);
         this.N().c().a(448, 0, 134217792);
         break;
      case 3:
         this.N().i().a(3);
         this.N().c().a(191, 0, 524296);
         this.N().c().a(385, 0, 134217793);
         this.N().c().a(448, 0, 134217792);
         break;
      case 4:
         this.N().i().a(19);
         this.N().c().a(191, 0, 524296);
         this.N().c().a(385, 0, 134217793);
         this.N().c().a(447, 0, 1048576);
         this.N().c().a(448, 0, 134217792);
         break;
      case 5:
         this.N().c().a(127, 0, 17039620);
         this.N().c().a(191, 0, 524296);
         this.N().c().a(385, 0, 134217806);
         this.N().c().a(387, 0, 134217805);
         this.N().c().a(447, 0, 1048592);
         this.N().c().a(448, 0, 134217805);
         this.N().c().a(511, 0, 524296);
         this.N().c().a(575, 0, 131072);
         this.N().i().a(201);
         break;
      case 6:
         this.N().i().a(202);
         this.N().c().a(128, 0, 30019360);
         this.N().c().a(139, 0, 2);
         this.N().c().a(191, 0, 524296);
         if (var1) {
            this.getFill().setType(2);
            this.getFill().getSolidFill().setColor(Color.getWhite());
            this.getLineFormat().setWeight(0.75D);
         } else {
            this.N().c().a(385, 0, 134217793);
         }

         this.N().c().a(448, 0, 134217792);
         break;
      case 7:
         this.N().i().a(201);
         this.N().c().a(127, 0, 16777472);
         this.N().c().a(128, 0, 30019308);
         this.N().c().a(133, 0, 1);
         this.N().c().a(139, 0, 2);
         this.N().c().a(191, 0, 1703944);
         this.N().c().a(385, 0, 134217793);
         this.N().c().a(447, 0, 1048576);
         this.N().c().a(448, 0, 134217792);
         this.N().c().a(511, 0, 524288);
         break;
      case 8:
         this.N().i().a(75);
         this.N().c().a(511, 0, 1572864);
         break;
      case 9:
      case 10:
      case 13:
      case 15:
      case 21:
      case 22:
      case 23:
      default:
         this.N().i().a(201);
         break;
      case 11:
         this.N().i().a(201);
         this.N().c().a(127, 0, 16777472);
         this.N().c().a(128, 0, 30019320);
         this.N().c().a(133, 0, 1);
         this.N().c().a(139, 0, 2);
         this.N().c().a(191, 0, 1703944);
         this.N().c().a(383, 0, 2687017);
         if (var1) {
            this.getFill().setType(1);
         } else {
            this.N().c().a(385, 0, 134217793);
            this.N().c().a(447, 0, 1048576);
         }

         this.N().c().a(448, 0, 134217792);
         this.N().c().a(511, 0, 524288);
         this.O().c(false);
         this.O().d(false);
         break;
      case 12:
         this.N().i().a(201);
         this.O().c(false);
         this.O().d(false);
         this.N().c().a(127, 0, 16777472);
         this.N().c().a(128, 0, 30019260);
         this.N().c().a(133, 0, 1);
         this.N().c().a(139, 0, 2);
         this.N().c().a(191, 0, 1703944);
         this.N().c().a(383, 0, 2687017);
         if (var1) {
            this.getFill().setType(1);
         } else {
            this.N().c().a(385, 0, 134217793);
            this.N().c().a(447, 0, 1048576);
         }

         this.N().c().a(448, 0, 134217792);
         this.N().c().a(511, 0, 524416);
         break;
      case 14:
         this.N().i().a(201);
         this.N().c().a(127, 0, 16777472);
         this.N().c().a(128, 0, 30019656);
         this.N().c().a(133, 0, 1);
         this.N().c().a(139, 0, 2);
         this.N().c().a(191, 0, 1703944);
         if (var1) {
            this.getFill().setType(1);
         } else {
            this.N().c().a(385, 0, 134217795);
            this.N().c().a(387, 0, 134217795);
            this.N().c().a(447, 0, 1114129);
         }

         this.N().c().a(448, 0, 134217792);
         this.O().c(false);
         this.O().d(false);
         break;
      case 16:
      case 17:
         this.N().i().a(201);
         this.N().c().a(127, 0, 17039620);
         this.N().c().a(191, 0, 524296);
         this.N().c().a(448, 0, 134217792);
         break;
      case 18:
      case 20:
         this.N().i().a(201);
         this.O().d(false);
         this.N().c().a(127, 0, 17039620);
         this.N().c().a(191, 0, 524296);
         this.N().c().a(448, 0, 134217792);
         this.N().c().a(511, 0, 524416);
         break;
      case 19:
         this.N().i().a(201);
         this.N().c().a(127, 0, 16777472);
         this.N().c().a(128, 0, 30019476);
         this.N().c().a(133, 0, 1);
         this.N().c().a(139, 0, 2);
         this.N().c().a(191, 0, 1703944);
         if (var1) {
            this.getFill().setType(1);
         } else {
            this.N().c().a(447, 0, 1048576);
         }

         this.N().c().a(448, 0, 134217792);
         this.N().c().a(511, 0, 524416);
         this.O().c(false);
         break;
      case 24:
         this.N().c().a(191, 0, 524296);
         this.N().c().a(385, 0, 134217793);
         this.N().c().a(387, 0, 134217793);
         this.N().c().a(447, 0, 1048592);
         this.N().c().a(448, 0, 134217792);
         this.N().c().a(511, 0, 524296);
         this.N().c().a(575, 0, 131072);
         this.N().i().c(true);
         this.N().i().a(75);
         break;
      case 25:
         this.N().i().a(202);
         this.N().c().a(128, 0, 30347012);
         this.N().c().a(139, 0, 2);
         this.N().c().a(191, 0, 524296);
         this.N().c().a(344, 0, 0);
         if (var1) {
            this.getFill().setType(2);
            this.getFill().getSolidFill().setColor(Color.getWhite());
            this.getLineFormat().setWeight(0.75D);
         } else {
            this.N().c().a(385, 0, 134217808);
            this.N().c().a(387, 0, 134217808);
            this.N().c().a(447, 0, 1048592);
         }

         this.N().c().a(513, 0, 0);
         this.N().c().a(575, 0, 196611);
         this.N().c().a(959, 0, 131074);
      }

   }

   zrt y() {
      return this.p;
   }

   int z() {
      if (!this.isGroup()) {
         return 1;
      } else {
         int var1 = 1;
         Shape[] var2 = ((GroupShape)this).getGroupedShapes();
         int var3 = var2.length;

         for(int var4 = 0; var4 < var3; ++var4) {
            Shape var5 = var2[var4];
            var1 += var5.z();
         }

         return var1;
      }
   }

   public String getName() {
      String var1 = this.N().c().e(50048);
      if (var1 != null && !"".equals(var1)) {
         return var1;
      } else {
         int var2 = this.N().i().b() - this.J().c().g();
         if (var2 > 0) {
            var2 %= 1024;
            switch(this.getMsoDrawingType()) {
            case 30:
               return "AutoShape " + var2;
            default:
               return zsl.d(this.getMsoDrawingType()) + " " + var2;
            }
         } else {
            return "Shape " + this.N().i().b();
         }
      }
   }

   public void setName(String value) {
      this.N().c().a(50048, 2, value);
   }

   public String getAlternativeText() {
      return this.N().c().e(50049);
   }

   public void setAlternativeText(String value) {
      this.N().c().a(50049, 2, value);
   }

   public String getTitle() {
      return this.a;
   }

   public void setTitle(String value) {
      this.a = value;
   }

   public MsoLineFormat getLineFormat() {
      return new MsoLineFormat(this);
   }

   public MsoFillFormat getFillFormat() {
      return new MsoFillFormat(this.getFill());
   }

   MsoFillFormatHelper A() {
      return new MsoFillFormatHelper(this, this.N().c(), this.L().n());
   }

   FillFormat B() {
      return this.b;
   }

   void C() {
      if (this.b == null) {
         this.b = new FillFormat(new MsoFillFormatHelper(this, this.N().c(), this.L().n()), this, this.L().n(), true);
         if (this.b.getType() == 4) {
            this.b.getTextureFill().setTiling(this.aj());
         }
      }

   }

   public FillFormat getFill() {
      if (this.b == null) {
         this.b = new FillFormat(new MsoFillFormatHelper(this, this.N().c(), this.L().n()), this, this.L().n(), false);
         if (this.b.getType() == 4) {
            this.b.getTextureFill().setTiling(this.aj());
         }
      }

      return this.b;
   }

   public MsoTextFrame getTextFrame() {
      return new MsoTextFrame(this);
   }

   public MsoFormatPicture getFormatPicture() {
      if (this.c == null) {
         this.c = new MsoFormatPicture(this);
      }

      return this.c;
   }

   boolean D() {
      switch(this.getMsoDrawingType()) {
      case 2:
         return ((RectangleShape)this).ab() != null;
      case 3:
         return ((Oval)this).ab() != null;
      case 4:
         return ((ArcShape)this).ab() != null;
      case 5:
      case 8:
      case 9:
      case 10:
      case 13:
      case 15:
      case 16:
      case 17:
      case 18:
      case 20:
      case 21:
      case 22:
      case 23:
      case 24:
      case 26:
      case 27:
      case 28:
      case 29:
      default:
         return false;
      case 6:
      case 7:
      case 11:
      case 12:
      case 14:
      case 19:
      case 25:
         return true;
      case 30:
         return ((CellsDrawing)this).ab() != null;
      }
   }

   public boolean isHidden() {
      return this.N().c().a(959, 1, false);
   }

   public void setHidden(boolean value) {
      this.N().c().b(959, 1, value);
   }

   public boolean isLockAspectRatio() {
      boolean var1 = false;
      switch(this.getMsoDrawingType()) {
      case 8:
      case 24:
         var1 = true;
      default:
         return this.N().c().a(127, 7, var1);
      }
   }

   public void setLockAspectRatio(boolean value) {
      this.N().c().b(127, 7, value);
   }

   public boolean getLockedProperty(int type) {
      boolean var2 = false;
      switch(type) {
      case 7:
         switch(this.getMsoDrawingType()) {
         case 8:
         case 24:
            var2 = true;
         }
      default:
         return this.N().c().a(127, type, var2);
      }
   }

   public void setLockedProperty(int type, boolean value) {
      this.N().c().b(127, type, value);
   }

   boolean E() {
      switch(this.getMsoDrawingType()) {
      case 8:
      case 24:
         return true;
      default:
         int var1 = this.N().c().c(127, 0);
         return (var1 & '\uffff') != 0;
      }
   }

   /** @deprecated */
   public int getRotation() {
      return (int)this.getRotationAngle();
   }

   /** @deprecated */
   public void setRotation(int value) {
      this.setRotationAngle((double)value);
   }

   public double getRotationAngle() {
      double var1 = (double)this.N().c().a(4, 0.0F);
      return var1;
   }

   public void setRotationAngle(double value) {
      double var3 = this.getRotationAngle();
      if (var3 != value) {
         if (!this.S()) {
            int var5 = this.getPlacement();
            this.setPlacement(0);
            int[] var6 = this.c(var3);
            this.a(0, false, var6[0], var6[1], var6[2], var6[3]);
            int[] var7 = this.d(value);
            this.a(var5, true, var7[0], var7[1], var7[2], var7[3]);
            this.setPlacement(var5);
         }

         this.a(value);
      }
   }

   void a(double var1) {
      this.N().c().b(4, (float)var1);
   }

   public Hyperlink addHyperlink(String address) {
      HyperlinkCollection var2 = new HyperlinkCollection((Object)null);
      var2.a(0, 0, 1, 1, address);
      this.N().c().a(50050, 3, var2.get(0));
      this.N().c().b(959, 3, true);
      return var2.get(0);
   }

   public void removeHyperlink() {
      this.N().c().b(50050);
      this.N().c().b(959, 3, false);
   }

   public Hyperlink getHyperlink() {
      return this.N().c().e();
   }

   Object F() {
      return this.n;
   }

   void a(Object var1) {
      this.n = var1;
   }

   void a(Shape var1, CopyOptions var2) {
      if (var1.g != null) {
         this.g = new zpq();
         if (var2.a) {
            this.g.a = var1.g.a;
            this.g.b = var1.g.b;
            this.g.d = var1.g.d;
         }

         this.g.a(var1.g, var2, this.L() == var1.L());
      }

      this.u = zyd.a(var1.L(), this.L(), var1.u, 0, 0, 0);
      this.N().a(var1.N(), var2);
      if (!var1.L().n().j() && this.L().n().j()) {
         this.getFill().a(var1.getFill(), var2);
         MsoLineFormat var3 = this.getLineFormat();
         MsoLineFormat var4 = var1.getLineFormat();
         var3.setStyle(var4.getStyle());
         var3.setWeight(var4.getWeight());
         var3.setForeColor(var4.getForeColor());
      } else if (var1.b != null) {
         this.getFill().a(var1.getFill(), var2);
      }

      if (var1.O() != null) {
         this.O().a(var1.O());
      } else {
         this.a((zanr)null);
      }

      if (var1.x != null) {
         if (var2.a) {
            this.x = var1.x;
            this.x.k = this;
         } else if (this.L() == var1.L()) {
            zpf var5 = var1.x;
            zpf var6 = new zpf(this, var5.e);
            var6.a(var5, var2);
            this.x = var6;
            var6.b = zase.y(this.N().i().b());
            this.g.b = "\u0000s" + var6.b;
         }
      }

      this.d(var1.v());
      this.q = var1.q;
      this.e = var1.e;
      this.q = var1.q;
      if (var1.w != null) {
         this.w = new zbtz(this);
         this.w.a(var1.w);
      }

      if (var1.p != null) {
         this.p = new zrt(this.getAutoShapeType());
         this.p.a(var1.p);
      } else {
         this.p = null;
      }

      if (var1.A != null) {
         if (var1.A.a()) {
            this.A = new CustomGeometry(this);
         } else {
            this.A = new zavh(this);
         }

         this.A.a(var1.A);
      }

      if (var1.f != null && (var2.a || var2.c == 1)) {
         this.f = new zmk();
         this.f.a(var1.f);
      }

      this.z = var1.z;
   }

   public void moveToRange(int upperLeftRow, int upperLeftColumn, int lowerRightRow, int lowerRightColumn) {
      int var5 = this.getPlacement();
      this.N().h().d(upperLeftColumn);
      this.N().h().e(0);
      this.N().h().b(upperLeftRow);
      this.N().h().c(0);
      this.N().h().h(lowerRightColumn);
      this.N().h().i(0);
      this.N().h().f(lowerRightRow);
      this.N().h().g(0);
      if (var5 != 2) {
         this.N().h().a(2);
         this.setPlacement(var5);
      }

   }

   public void alignTopRightCorner(int topRow, int rightColumn) {
      int var3 = this.getPlacement();
      this.setPlacement(1);
      this.N().h().c(0);
      this.N().h().b(topRow);
      int var4 = this.N().h().p();
      int[] var5 = new int[]{rightColumn + 1, 0, -var4};
      this.M().getCells().c.a(var5);
      this.N().h().d(var5[0]);
      this.N().h().e(var5[1]);
      this.setPlacement(var3);
   }

   void a(int var1, int var2, int var3, int var4) {
      int var5 = this.getPlacement();
      this.setPlacement(1);
      boolean var6 = false;
      int var7;
      if (var2 != 0) {
         var7 = this.M().getCells().getRowHeightPixel(var1);
         this.N().h().b(var1);
         this.N().h().c(var2);
      } else {
         this.N().h().b(var1);
         this.N().h().c(0);
      }

      if (var4 != 0) {
         var7 = this.M().getCells().c(var3);
         this.N().h().d(var3);
         this.N().h().e(var4);
      } else {
         this.N().h().d(var3);
         this.N().h().e(0);
      }

      this.setPlacement(var5);
   }

   void a(int var1, int var2, int var3, int var4, int var5) {
      this.N().h().a(var1);
      this.N().h().e(var2);
      this.N().h().c(var3);
      if (var1 == 2) {
         this.N().h().i(var4 + var2);
         this.N().h().g(var5 + var3);
      } else {
         Chart var6 = (Chart)this.J().h();
         double var7 = (double)var6.getChartObject().getWidth();
         double var9 = (double)var6.getChartObject().getHeight();
         int var11 = (int)((double)var4 * var7 / 4000.0D + 0.5D);
         this.N().h().i(var11);
         var11 = (int)((double)var5 * var9 / 4000.0D + 0.5D);
         this.N().h().g(var11);
      }

   }

   void a(int var1, boolean var2, int var3, int var4, int var5, int var6) {
      this.g(0);
      this.N().h().c(var4);
      this.N().h().e(var3);
      this.N().h().i(var5);
      this.N().h().g(var6);
      if (var2 && var1 != 0) {
         this.setPlacement(var1);
      }

   }

   void b(int var1, int var2, int var3, int var4) {
      this.g(0);
      this.N().h().e = (double)var2;
      this.N().h().d = (double)var1;
      this.N().h().g = (double)var3;
      this.N().h().f = (double)var4;
   }

   int[] G() {
      return new int[]{(int)this.N().h().d, (int)this.N().h().e, (int)this.N().h().g, (int)this.N().h().f};
   }

   void a(int[] var1, int[] var2, int[] var3, int[] var4) {
      int var5 = this.getPlacement();
      if (var5 != 2) {
         this.setPlacement(2);
      }

      var1[0] = this.N().h().j();
      var2[0] = this.N().h().g();
      var3[0] = this.N().h().p();
      var4[0] = this.N().h().m();
      if (var5 != 2) {
         this.setPlacement(var5);
      }

   }

   int[] d(boolean var1) {
      int var2 = this.getPlacement();
      if (var1 && var2 != 0) {
         this.setPlacement(0);
      }

      int[] var3 = new int[]{this.N().h().j(), this.N().h().g(), this.N().h().p(), this.N().h().m()};
      if (var1 && var2 != 0) {
         this.setPlacement(var2);
      }

      return var3;
   }

   void a(int var1, int var2, int var3, int var4, int var5, int var6) {
      this.N().h().a(1);
      if (this.Q()) {
         this.N().h().e(0);
         this.N().h().c(0);
         this.N().h().i(var6);
         this.N().h().g(var5);
      } else {
         if (this.P()) {
            ChartShape var7 = ((Chart)this.J().h()).getChartObject();
            int var8 = var7.getLeftToCorner();
            int var9 = var7.getTopToCorner();
            int var10 = var7.getWidth();
            int var11 = var7.getHeight();
            int var12 = this.d(0, 0, var3, 0) + var4;
            int var13 = this.c(0, 0, var1, 0) + var2;
            int var14 = var12 - var8;
            var4 = (int)((double)((float)var14 * 4000.0F / (float)var10) + 0.5D);
            if (var4 < 0) {
               var4 = 0;
            } else if ((float)var4 > 4000.0F) {
               var4 = 4000;
            }

            int var15 = var13 - var9;
            var2 = (int)((double)((float)var15 * 4000.0F / (float)var10) + 0.5D);
            if (var2 < 0) {
               var2 = 0;
            } else if ((float)var2 > 4000.0F) {
               var2 = 4000;
            }

            this.N().h().i(var6);
            this.N().h().g(var5);
            this.N().h().e(var4);
            this.N().h().c(var2);
         } else {
            this.N().h().i(var6);
            this.N().h().g(var5);
            this.N().h().d(var3);
            this.N().h().e(var4);
            this.N().h().b(var1);
            this.N().h().c(var2);
         }

      }
   }

   double[] H() {
      int var1 = this.L().M();
      int var2;
      int var3;
      int var4;
      int var5;
      double var6;
      double var8;
      double var10;
      double var12;
      if (!this.P() && !this.S()) {
         int var14 = this.getPlacement();
         this.setPlacement(2);
         var3 = this.N().h().i();
         double var15 = this.N().h().k();
         if (var15 > (double)this.M().getCells().getColumnWidthPixel(var3)) {
            ++var3;
            var15 = 0.0D;
            this.N().h().d(var3);
            this.N().h().b(var15);
         }

         var8 = zbuc.a(var15, var1);
         var2 = this.N().h().f();
         double var17 = this.N().h().h();
         if (var17 > (double)this.M().getCells().getRowHeightPixel(var2)) {
            ++var2;
            var17 = 0.0D;
            this.N().h().a(var17);
            this.N().h().b(var2);
         }

         var6 = zbuc.a(var17, var1);
         var5 = this.N().h().o();
         double var19 = this.N().h().q();
         if (var19 > (double)this.M().getCells().getColumnWidthPixel(var5)) {
            ++var5;
            var19 = 0.0D;
            this.N().h().h(var5);
            this.N().h().d(var19);
         }

         var12 = zbuc.a(var19, var1);
         var4 = this.N().h().l();
         double var21 = this.N().h().n();
         if (var21 > (double)this.M().getCells().getRowHeightPixel(var4)) {
            ++var4;
            var21 = 0.0D;
            this.N().h().f(var4);
            this.N().h().c(var21);
         }

         var10 = zbuc.a(var21, var1);
         this.setPlacement(var14);
      } else {
         var3 = this.getUpperLeftColumn();
         var8 = zbuc.a((double)this.getLeft(), var1);
         var2 = this.getUpperLeftRow();
         var6 = zbuc.a((double)this.getTop(), var1);
         var5 = this.getLowerRightColumn();
         var12 = zbuc.a((double)this.getRight(), var1);
         var4 = this.getLowerRightRow();
         var10 = zbuc.a((double)this.getBottom(), var1);
      }

      return new double[]{(double)var3, var8, (double)var2, var6, (double)var5, var12, (double)var4, var10, this.getWidthPt(), this.getHeightPt()};
   }

   int[] I() {
      int var1 = this.L().M();
      int var2;
      int var3;
      int var4;
      int var5;
      int var6;
      int var7;
      int var8;
      int var9;
      if (!this.P() && !this.S()) {
         int var10 = this.getPlacement();
         this.setPlacement(2);
         var4 = this.N().h().i();
         var5 = zase.a(this.N().h().k(), var1);
         var2 = this.N().h().f();
         var3 = zase.a(this.N().h().h(), var1);
         var8 = this.N().h().o();
         var9 = zase.a(this.N().h().q(), var1);
         var6 = this.N().h().l();
         var7 = zase.a(this.N().h().n(), var1);
         this.setPlacement(var10);
      } else {
         var4 = this.getUpperLeftColumn();
         var5 = zase.a((double)this.getLeft(), var1);
         var2 = this.getUpperLeftRow();
         var3 = zase.a((double)this.getTop(), var1);
         var8 = this.getLowerRightColumn();
         var9 = zase.a((double)this.getRight(), var1);
         var6 = this.getLowerRightRow();
         var7 = zase.a((double)this.getBottom(), var1);
      }

      return new int[]{var4, var5, var2, var3, var8, var9, var6, var7};
   }

   void a(int var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9) {
      zjy var10;
      if (this.N().h().c == null) {
         this.N().h().a(2);
         this.N().h().d(var4);
         this.N().h().b(this.a(var4, var5));
         this.N().h().b(var2);
         this.N().h().a(this.b(var2, var3));
         this.N().h().h(var8);
         this.N().h().d(this.a(var8, var9));
         this.N().h().f(var6);
         this.N().h().c(this.b(var6, var7));
         var10 = new zjy();
         var10.a = var1;
         var10.f = var4;
         var10.h = var2;
         var10.g = var8;
         var10.i = var6;
         var10.b = var5;
         var10.c = var3;
         var10.d = var7;
         var10.e = var9;
         this.N().h().c = var10;
      } else {
         var10 = this.N().h().c;
         this.N().h().a(2);
         this.N().h().b(this.a(var10.f, var10.b));
         this.N().h().a(this.b(var10.h, var10.c));
         this.N().h().d(this.a(var10.g, var10.e));
         this.N().h().c(this.b(var10.i, var10.d));
         this.N().h().c = null;
      }

   }

   void a(int var1, int var2, double var3, int var5, double var6, int var8, double var9, int var11, double var12) {
      this.N().h().d(var5);
      this.N().h().b(var6);
      this.N().h().b(var2);
      this.N().h().a(var3);
      this.N().h().h(var11);
      this.N().h().d(var12);
      this.N().h().f(var8);
      this.N().h().c(var9);
      this.g(2);
      if (var1 != 2) {
         this.setPlacement(var1);
      }

   }

   ShapeCollection J() {
      return this.j;
   }

   public int getId() {
      return this.m;
   }

   public String getSpid() {
      return this.g != null ? this.g.b : null;
   }

   public int getSpt() {
      switch(this.getMsoDrawingType()) {
      case 8:
         if (this.x != null) {
            return 201;
         }
      default:
         return this.getAutoShapeType();
      case 24:
         return 75;
      }
   }

   int K() {
      return this.m;
   }

   void f(int var1) {
      this.m = var1;
   }

   WorksheetCollection L() {
      return this.j.i();
   }

   Worksheet M() {
      return this.j.j();
   }

   zbnw N() {
      return this.k;
   }

   zanr O() {
      return this.l;
   }

   void a(zanr var1) {
      this.l = var1;
   }

   public boolean isGroup() {
      if (this.O() == null) {
         return false;
      } else {
         return this.getMsoDrawingType() == 0;
      }
   }

   boolean P() {
      return this.j.f();
   }

   boolean Q() {
      return this.j.f() && this.M().getType() == 2;
   }

   boolean R() {
      return this.j.g();
   }

   boolean S() {
      return this.n instanceof Shape ? ((Shape)this.n).isGroup() : false;
   }

   int T() {
      if (this.U()) {
         return 90;
      } else {
         int var1 = this.N().j() + 8;
         if (this.isGroup()) {
            var1 += 8;
         }

         return var1;
      }
   }

   boolean U() {
      if (this.getMsoDrawingType() == 20 && this.N().h().b()) {
         return ((ComboBox)this).a() != null;
      } else {
         return false;
      }
   }

   public boolean isWordArt() {
      String var1 = this.N().c().e(49344);
      return var1 != null && !"".equals(var1);
   }

   public TextEffectFormat getTextEffect() {
      return new TextEffectFormat(this);
   }

   zanx V() {
      return new zanx(this);
   }

   public boolean isLocked() {
      return this.O() == null ? true : this.O().a();
   }

   public void setLocked(boolean value) {
      if (this.O() != null) {
         this.O().a(value);
      }
   }

   public boolean isPrintable() {
      return this.O() == null ? true : this.O().b();
   }

   public void setPrintable(boolean value) {
      if (this.O() != null) {
         this.O().b(value);
      }
   }

   /** @deprecated */
   public boolean isPrinted() {
      return this.isPrintable();
   }

   /** @deprecated */
   public void setPrinted(boolean value) {
      this.setPrintable(true);
   }

   public int getMsoDrawingType() {
      return this.O() == null ? 8 : this.O().f();
   }

   public int getAutoShapeType() {
      return this.N().i().a();
   }

   public void setAutoShapeType(int value) {
      this.N().i().a((short)value);
   }

   void g(int var1) {
      this.N().h().a(var1);
   }

   public int getPlacement() {
      return this.N().h().e();
   }

   public void setPlacement(int value) {
      if (!this.b()) {
         if (!this.S()) {
            if (this.N().h().e() != value) {
               double var2 = 0.0D;
               double var4 = 0.0D;
               if (this.P()) {
                  if (value != 0) {
                     Chart var19 = (Chart)this.J().h();
                     var2 = (double)var19.getChartObject().getWidth();
                     var4 = (double)var19.getChartObject().getHeight();
                     if (this.N().h().e() == 2) {
                        int var20 = (int)(var2 * (double)(this.N().h().p() - this.N().h().j()) / 4000.0D + 0.5D);
                        this.N().h().i(var20);
                        var20 = (int)(var4 * (double)(this.N().h().m() - this.N().h().g()) / 4000.0D + 0.5D);
                        this.N().h().g(var20);
                     } else {
                        this.N().h().i((int)((double)((float)this.N().h().p() * 4000.0F) / var2 + 0.5D) + this.N().h().j());
                        this.N().h().g((int)((double)((float)this.N().h().m() * 4000.0F) / var4 + 0.5D) + this.N().h().g());
                     }

                     this.N().h().a(value);
                  }
               } else {
                  int var6 = this.N().h().f();
                  double var7 = this.N().h().h();
                  int var9 = this.N().h().i();
                  double var10 = this.N().h().k();
                  int var12 = this.N().h().l();
                  double var13 = this.N().h().n();
                  int var15 = this.N().h().o();
                  double var16 = this.N().h().q();
                  if (this.N().h().e() == 2) {
                     if (value == 0) {
                        var2 = this.b(0, 0.0D, var9, var10);
                        var4 = this.a(0, 0.0D, var6, var7);
                        this.N().h().a(var4);
                        this.N().h().b(var2);
                     }

                     var2 = this.b(var9, var10, var15, var16);
                     var4 = this.a(var6, var7, var12, var13);
                     this.N().h().d(var2);
                     this.N().h().c(var4);
                     this.N().h().a(value);
                  } else {
                     double[] var18;
                     if (this.N().h().e() == 1) {
                        if (value == 2) {
                           var18 = this.b(var9, var10, var16);
                           this.N().h().h((int)var18[0]);
                           this.N().h().d(var18[1]);
                           var18 = this.a(var6, var7, var13);
                           this.N().h().f((int)var18[0]);
                           this.N().h().c(var18[1]);
                        } else if (value == 0) {
                           var2 = this.b(0, 0.0D, var9, var10);
                           this.N().h().b(var2);
                           var4 = this.a(0, 0.0D, var6, var7);
                           this.N().h().a(var4);
                        }

                        this.N().h().a(value);
                     } else if (this.N().h().e() == 0) {
                        var18 = this.a(0, 0.0D, var7);
                        this.N().h().b((int)var18[0]);
                        this.N().h().a(var18[1]);
                        var6 = (int)var18[0];
                        var7 = var18[1];
                        var18 = this.b(0, 0.0D, var10);
                        this.N().h().d((int)var18[0]);
                        this.N().h().b(var18[1]);
                        var9 = (int)var18[0];
                        var10 = var18[1];
                        if (value == 2) {
                           var18 = this.a(var6, var7, var13);
                           this.N().h().f((int)var18[0]);
                           this.N().h().c(var18[1]);
                           var18 = this.b(var9, var10, var16);
                           this.N().h().h((int)var18[0]);
                           this.N().h().d(var18[1]);
                        }

                        this.N().h().a(value);
                     }
                  }
               }
            }
         }
      }
   }

   public int getUpperLeftRow() {
      if (this.b()) {
         return 0;
      } else if (this.S()) {
         GroupShape var4 = (GroupShape)this.n;
         int var5 = (int)((double)((float)(this.N().h().g() * var4.getHeight()) / 4000.0F) + 0.5D);
         int[] var3 = this.a(var4.getUpperLeftRow(), var4.getTop(), var5);
         return var3[0];
      } else if (this.P()) {
         return 0;
      } else if (this.getPlacement() != 1 && this.getPlacement() != 2) {
         int var1 = this.N().h().g();
         int[] var2 = this.a(0, 0, var1);
         return var2[0];
      } else {
         return this.N().h().f();
      }
   }

   public void setUpperLeftRow(int value) {
      zakq.a(value);
      if (!this.b()) {
         if (!this.S()) {
            if (!this.P()) {
               int var2 = this.getPlacement();
               this.setPlacement(1);
               this.N().h().b(value);
               this.setPlacement(var2);
            }
         }
      }
   }

   public int getUpperDeltaY() {
      if (this.b()) {
         return 0;
      } else if (this.P()) {
         return 0;
      } else {
         double var1 = (double)this.getTop();
         return this.b(this.getUpperLeftRow(), var1);
      }
   }

   public void setUpperDeltaY(int value) {
      if (value >= 0 && (double)value <= zjx.b) {
         if (!this.b()) {
            if (!this.S()) {
               if (!this.P()) {
                  int var2 = this.getPlacement();
                  this.setPlacement(1);
                  this.N().h().c(value);
                  this.setPlacement(var2);
               }
            }
         }
      }
   }

   public int getUpperLeftColumn() {
      if (this.b()) {
         return 0;
      } else if (this.S()) {
         GroupShape var4 = (GroupShape)this.n;
         int var5 = (int)((double)((float)(this.N().h().j() * var4.getWidth()) / 4000.0F) + 0.5D);
         int[] var3 = this.b(var4.getUpperLeftColumn(), var4.getLeft(), var5);
         return var3[0];
      } else if (this.P()) {
         return 0;
      } else if (this.getPlacement() != 1 && this.getPlacement() != 2) {
         int var1 = this.N().h().j();
         int[] var2 = this.b(0, 0, var1);
         return var2[0];
      } else {
         return this.N().h().i();
      }
   }

   public void setUpperLeftColumn(int value) {
      zakq.b(value);
      if (!this.b()) {
         if (!this.S()) {
            if (!this.P()) {
               int var2 = this.getPlacement();
               this.setPlacement(1);
               this.N().h().d(value);
               this.setPlacement(var2);
            }
         }
      }
   }

   public int getUpperDeltaX() {
      if (this.b()) {
         return 0;
      } else if (this.P()) {
         return 0;
      } else {
         int var1 = this.getLeft();
         return this.a(this.getUpperLeftColumn(), (double)var1);
      }
   }

   public void setUpperDeltaX(int value) {
      if (value >= 0) {
         if (!this.b()) {
            if (!this.S()) {
               if (!this.P()) {
                  this.setLeft((int)(this.a(this.getUpperLeftColumn(), value) + 0.5D));
               }
            }
         }
      }
   }

   public int getLowerRightRow() {
      if (this.b()) {
         return 0;
      } else if (this.P()) {
         return 0;
      } else {
         int var2;
         if (this.S()) {
            GroupShape var5 = (GroupShape)this.n;
            var2 = (int)((double)((float)((this.N().h().g() + this.N().h().m()) * var5.getHeight()) / 4000.0F) + 0.5D);
            int[] var6 = this.a(var5.getUpperLeftRow(), var5.getTop(), var2);
            return var6[0];
         } else if (this.getPlacement() == 2) {
            return this.N().h().l();
         } else {
            int var1 = this.getHeight();
            var2 = 0;
            int var3 = 0;
            if (this.getPlacement() == 1) {
               var2 = this.getUpperLeftRow();
               var3 = this.getTop();
            } else {
               var1 += this.getTopToCorner();
            }

            int[] var4 = this.a(var2, var3, var1);
            return var4[0];
         }
      }
   }

   public void setLowerRightRow(int value) {
      zakq.a(value);
      if (!this.b()) {
         if (!this.S()) {
            if (!this.P()) {
               int var2 = this.getBottom();
               int var3 = this.getPlacement();
               this.setPlacement(1);
               int[] var4 = new int[]{value, var2, -this.getHeight()};
               this.M().getCells().getRows().b.a(var4);
               this.N().h().b(var4[0]);
               this.N().h().c(var4[1]);
               this.setPlacement(var3);
            }
         }
      }
   }

   public int getLowerDeltaY() {
      if (this.b()) {
         return 0;
      } else {
         return this.P() ? 0 : this.b(this.getLowerRightRow(), (double)this.getBottom());
      }
   }

   public void setLowerDeltaY(int value) {
      if (value >= 0) {
         if (!this.b()) {
            if (!this.S()) {
               if (!this.P()) {
                  this.setBottom((int)(this.b(this.getLowerRightRow(), value) + 0.5D));
               }
            }
         }
      }
   }

   public int getLowerRightColumn() {
      if (this.b()) {
         return 0;
      } else {
         int var2;
         if (this.S()) {
            GroupShape var5 = (GroupShape)this.n;
            var2 = (int)((double)((float)((this.N().h().j() + this.N().h().p()) * var5.getWidth()) / 4000.0F) + 0.5D);
            int[] var6 = this.b(var5.getUpperLeftColumn(), var5.getLeft(), var2);
            return var6[0];
         } else if (this.P()) {
            return 0;
         } else if (this.getPlacement() == 2) {
            return this.N().h().o();
         } else {
            int var1 = 0;
            var2 = 0;
            int var3 = this.getWidth();
            if (this.getPlacement() == 1) {
               var1 = this.getUpperLeftColumn();
               var2 = this.getLeft();
            } else {
               var3 += this.getLeftToCorner();
            }

            int[] var4 = this.b(var1, var2, var3);
            return var4[0];
         }
      }
   }

   public void setLowerRightColumn(int value) {
      zakq.b(value);
      if (!this.b()) {
         if (!this.S()) {
            if (!this.P()) {
               int var2 = this.getRight();
               int var3 = this.getPlacement();
               this.setPlacement(1);
               int[] var4 = new int[]{value, var2, -this.getWidth()};
               this.M().getCells().c.a(var4);
               this.N().h().d(var4[0]);
               this.N().h().e(var4[1]);
               this.setPlacement(var3);
            }
         }
      }
   }

   public int getLowerDeltaX() {
      if (this.b()) {
         return 0;
      } else {
         return this.P() ? 0 : this.a(this.getLowerRightColumn(), (double)this.getRight());
      }
   }

   public void setLowerDeltaX(int value) {
      if (value >= 0) {
         if (!this.b()) {
            if (!this.S()) {
               if (!this.P()) {
                  int var2 = this.getLowerRightColumn();
                  this.setRight((int)(this.a(var2, value) + 0.5D));
               }
            }
         }
      }
   }

   public int getRight() {
      if (this.b()) {
         return 0;
      } else {
         int var2;
         if (this.S()) {
            GroupShape var5 = (GroupShape)this.n;
            var2 = (int)((double)((float)((this.N().h().j() + this.N().h().p()) * var5.getWidth()) / 4000.0F) + 0.5D);
            int[] var6 = this.b(var5.getUpperLeftColumn(), var5.getLeft(), var2);
            return var6[1];
         } else if (this.P()) {
            return 0;
         } else if (this.getPlacement() == 2) {
            return this.N().h().p();
         } else {
            int var1 = 0;
            var2 = 0;
            int var3 = this.getWidth();
            if (this.getPlacement() == 1) {
               var1 = this.getUpperLeftColumn();
               var2 = this.getLeft();
            } else {
               var3 += this.getLeftToCorner();
            }

            int[] var4 = this.b(var1, var2, var3);
            return var4[1];
         }
      }
   }

   public void setRight(int value) {
      zakq.b(value);
      if (!this.b()) {
         if (!this.S()) {
            if (!this.P()) {
               int var2 = this.getLowerRightColumn();
               int var3 = this.getPlacement();
               this.setPlacement(1);
               int[] var4 = new int[]{var2, value, -this.getWidth()};
               this.M().getCells().c.a(var4);
               this.N().h().d(var4[0]);
               this.N().h().e(var4[1]);
               this.setPlacement(var3);
            }
         }
      }
   }

   public int getBottom() {
      if (this.b()) {
         return 0;
      } else if (this.P()) {
         return 0;
      } else {
         int var2;
         if (this.S()) {
            GroupShape var5 = (GroupShape)this.n;
            var2 = (int)((double)((float)((this.N().h().g() + this.N().h().m()) * var5.getHeight()) / 4000.0F) + 0.5D);
            int[] var6 = this.a(var5.getUpperLeftRow(), var5.getTop(), var2);
            return var6[1];
         } else if (this.getPlacement() == 2) {
            return this.N().h().m();
         } else {
            int var1 = this.getHeight();
            var2 = 0;
            int var3 = 0;
            if (this.getPlacement() == 1) {
               var2 = this.getUpperLeftRow();
               var3 = this.getTop();
            } else {
               var1 += this.getTopToCorner();
            }

            int[] var4 = this.a(var2, var3, var1);
            return var4[1];
         }
      }
   }

   public void setBottom(int value) {
      zakq.a(value);
      if (!this.b()) {
         if (!this.S()) {
            if (!this.P()) {
               int var2 = this.getLowerRightRow();
               int var3 = this.getPlacement();
               this.setPlacement(1);
               int[] var4 = new int[]{var2, value, -this.getHeight()};
               this.M().getCells().getRows().b.a(var4);
               this.N().h().b(var4[0]);
               this.N().h().c(var4[1]);
               this.setPlacement(var3);
            }
         }
      }
   }

   public int getWidth() {
      if (!this.S()) {
         if (this.P()) {
            switch(this.getPlacement()) {
            case 1:
               return this.N().h().p();
            case 2:
               Chart var7 = (Chart)this.J().h();
               return (int)((double)((float)(var7.getChartObject().getWidth() * (this.N().h().p() - this.N().h().j())) / 4000.0F) + 0.5D);
            default:
               return 0;
            }
         } else if (this.getPlacement() != 1 && this.getPlacement() != 0) {
            int var6 = this.N().h().i();
            int var2 = this.N().h().o();
            int var3 = this.N().h().j();
            int var4 = this.N().h().p();
            int var5 = this.d(var6, var3, var2, var4);
            return var5;
         } else {
            return this.N().h().p();
         }
      } else {
         GroupShape var1 = (GroupShape)this.n;
         if ((var1.getRotationAngle() < 45.0D || var1.getRotationAngle() >= 135.0D) && (var1.getRotationAngle() < 225.0D || var1.getRotationAngle() >= 315.0D)) {
            if (!(this instanceof GroupShape)) {
               return (int)((double)((float)this.N().h().p() / 4000.0F * (float)var1.getWidth()) + 0.5D);
            } else {
               return (this.getRotationAngle() < 45.0D || this.getRotationAngle() >= 135.0D) && (this.getRotationAngle() < 225.0D || this.getRotationAngle() >= 315.0D) ? (int)((double)((float)this.N().h().p() / 4000.0F * (float)var1.getWidth()) + 0.5D) : (int)((double)((float)this.N().h().m() / 4000.0F * (float)var1.getHeight()) + 0.5D);
            }
         } else if (!(this instanceof GroupShape)) {
            return (int)((double)((float)this.N().h().p() / 4000.0F * (float)var1.getHeight()) + 0.5D);
         } else {
            return (this.getRotationAngle() < 45.0D || this.getRotationAngle() >= 135.0D) && (this.getRotationAngle() < 225.0D || this.getRotationAngle() >= 315.0D) ? (int)((double)((float)this.N().h().p() / 4000.0F * (float)var1.getHeight()) + 0.5D) : (int)((double)((float)this.N().h().m() / 4000.0F * (float)var1.getWidth()) + 0.5D);
         }
      }
   }

   public void setWidth(int value) {
      if (!this.S()) {
         int var3;
         if (this.P()) {
            switch(this.getPlacement()) {
            case 1:
               this.N().h().i(value);
               break;
            case 2:
               Chart var5 = (Chart)this.J().h();
               var3 = (int)((double)(4000.0F * (float)value / (float)var5.getChartObject().getWidth()) + 0.5D) + this.N().h().j();
               this.N().h().i(var3 > 4000 ? 4000 : var3);
            }

         } else if (this.getPlacement() != 1 && this.getPlacement() != 0) {
            int var2 = this.N().h().i();
            var3 = this.N().h().j();
            int[] var4 = this.b(var2, var3, value);
            this.N().h().h(var4[0]);
            this.N().h().i(var4[1]);
         } else {
            this.N().h().i(value);
         }
      }
   }

   public double getWidthInch() {
      return this.b((double)this.getWidth());
   }

   public void setWidthInch(double value) {
      this.setWidth(this.e(value));
   }

   public double getWidthPt() {
      return (double)((float)this.getWidth() * 72.0F / (float)this.L().L());
   }

   public void setWidthPt(double value) {
      this.setWidth((int)(value * (double)this.L().L() / 72.0D + 0.5D));
   }

   public double getWidthCM() {
      return this.h(this.getWidth());
   }

   public void setWidthCM(double value) {
      this.setWidth(this.f(value));
   }

   public int getHeight() {
      int var2;
      int var3;
      if (!this.S()) {
         if (this.P()) {
            switch(this.getPlacement()) {
            case 1:
               return this.N().h().m();
            case 2:
               Chart var7 = (Chart)this.J().h();
               return (int)((double)((float)(var7.getChartObject().getHeight() * (this.N().h().m() - this.N().h().g())) / 4000.0F) + 0.5D);
            default:
               return 0;
            }
         } else if (this.getPlacement() != 1 && this.getPlacement() != 0) {
            int var6 = this.N().h().f();
            var2 = this.N().h().l();
            var3 = this.N().h().g();
            int var4 = this.N().h().m();
            int var5 = this.c(var6, var3, var2, var4);
            return var5;
         } else {
            return this.N().h().m();
         }
      } else {
         GroupShape var1 = (GroupShape)this.n;
         if (var1.getRotationAngle() >= 45.0D && var1.getRotationAngle() < 135.0D || var1.getRotationAngle() >= 225.0D && var1.getRotationAngle() < 315.0D) {
            if (!(this instanceof GroupShape)) {
               return (int)((double)((float)(this.N().h().m() * var1.getWidth()) / 4000.0F) + 0.5D);
            } else {
               return (this.getRotationAngle() < 45.0D || this.getRotationAngle() >= 135.0D) && (this.getRotationAngle() < 225.0D || this.getRotationAngle() >= 315.0D) ? (int)((double)((float)(this.N().h().m() * var1.getWidth()) / 4000.0F) + 0.5D) : (int)((double)((float)this.N().h().p() / 4000.0F * (float)var1.getHeight()) + 0.5D);
            }
         } else if (!(this instanceof GroupShape)) {
            var2 = (int)((double)((float)(this.N().h().m() * var1.getHeight()) / 4000.0F) + 0.5D);
            var3 = Math.max(var1.getWidth(), var1.getHeight());
            if (var2 > var3 && this.getType() == 32) {
               var2 = var3;
            }

            return var2;
         } else {
            return (this.getRotationAngle() < 45.0D || this.getRotationAngle() >= 135.0D) && (this.getRotationAngle() < 225.0D || this.getRotationAngle() >= 315.0D) ? (int)((double)((float)(this.N().h().m() * var1.getHeight()) / 4000.0F) + 0.5D) : (int)((double)((float)(this.N().h().p() * var1.getWidth()) / 4000.0F) + 0.5D);
         }
      }
   }

   public void setHeight(int value) {
      if (!this.S()) {
         int var3;
         if (this.P()) {
            switch(this.getPlacement()) {
            case 1:
               this.N().h().g(value);
               break;
            case 2:
               Chart var5 = (Chart)this.J().h();
               var3 = (int)((double)(4000.0F * (float)value / (float)var5.getChartObject().getHeight()) + 0.5D) + this.N().h().g();
               this.N().h().g(var3 > 4000 ? 4000 : var3);
            }

         } else if (this.getPlacement() != 1 && this.getPlacement() != 0) {
            int var2 = this.N().h().f();
            var3 = this.N().h().g();
            int[] var4 = this.a(var2, var3, value);
            this.N().h().f(var4[0]);
            this.N().h().g(var4[1]);
         } else {
            this.N().h().g(value);
         }
      }
   }

   public double getHeightInch() {
      return this.b((double)this.getHeight());
   }

   public void setHeightInch(double value) {
      this.setHeight(this.e(value));
   }

   public double getHeightPt() {
      return (double)((float)this.getHeight() * 72.0F / (float)this.L().L());
   }

   public void setHeightPt(double value) {
      this.setHeight((int)(value * (double)this.L().L() / 72.0D + 0.5D));
   }

   public double getHeightCM() {
      return this.h(this.getHeight());
   }

   public void setHeightCM(double value) {
      this.setHeight(this.f(value));
   }

   public int getLeft() {
      if (this.P()) {
         Chart var5 = (Chart)this.J().h();
         return (int)((double)((float)(var5.getChartObject().getWidth() * this.N().h().j()) / 4000.0F) + 0.5D);
      } else if (this.S()) {
         GroupShape var4 = (GroupShape)this.n;
         int var2 = (int)((double)((float)(this.N().h().j() * var4.getWidth()) / 4000.0F) + 0.5D);
         int[] var3 = this.b(var4.getUpperLeftColumn(), var4.getLeft(), var2);
         return var3[1];
      } else if (this.getPlacement() != 0) {
         return this.N().h().j();
      } else {
         int[] var1 = this.b(0, 0, this.getLeftToCorner());
         return var1[1];
      }
   }

   public void setLeft(int value) {
      if (!this.S()) {
         if (this.P()) {
            Chart var4 = (Chart)this.J().h();
            int var3 = (int)((double)((float)value * 4000.0F / (float)var4.getChartObject().getWidth()) + 0.5D);
            var3 = var3 > 4000 ? 4000 : var3;
            this.N().h().e(var3);
         } else {
            int var2 = this.getPlacement();
            this.setPlacement(1);
            this.N().h().e(value);
            this.setPlacement(var2);
         }
      }
   }

   public double getLeftInch() {
      return this.b((double)this.getLeft());
   }

   public void setLeftInch(double value) {
      this.setLeft(this.e(value));
   }

   public double getLeftCM() {
      return this.h(this.getLeft());
   }

   public void setLeftCM(double value) {
      this.setLeft(this.f(value));
   }

   public int getTop() {
      if (this.b()) {
         return 0;
      } else if (this.P()) {
         Chart var5 = (Chart)this.J().h();
         return (int)((double)((float)(this.N().h().g() * var5.getChartObject().getHeight()) / 4000.0F) + 0.5D);
      } else if (this.S()) {
         GroupShape var4 = (GroupShape)this.n;
         int var2 = (int)((double)((float)(this.N().h().g() * var4.getHeight()) / 4000.0F) + 0.5D);
         int[] var3 = this.a(var4.getUpperLeftRow(), var4.getTop(), var2);
         return var3[1];
      } else if (this.getPlacement() != 0) {
         return this.N().h().g();
      } else {
         int[] var1 = this.a(0, 0, this.getTopToCorner());
         return var1[1];
      }
   }

   public void setTop(int value) {
      if (!this.S()) {
         if (this.P()) {
            Chart var4 = (Chart)this.J().h();
            int var3 = (int)((double)((float)value * 4000.0F / (float)var4.getChartObject().getHeight()) + 0.5D);
            var3 = var3 > 4000 ? 4000 : var3;
            this.N().h().c(var3);
         } else {
            int var2 = this.getPlacement();
            this.setPlacement(1);
            this.N().h().c(value);
            this.setPlacement(var2);
         }
      }
   }

   public double getTopInch() {
      return this.b((double)this.getTop());
   }

   public void setTopInch(double value) {
      this.setTop(this.e(value));
   }

   public double getTopCM() {
      return this.h(this.getTop());
   }

   public void setTopCM(double value) {
      this.setTop(this.f(value));
   }

   public int getTopToCorner() {
      if (this.P()) {
         return 0;
      } else if (this.S()) {
         GroupShape var1 = this.getGroup();
         return (int)((double)((float)var1.getTopToCorner() + (float)this.getTopInShape() / 4000.0F * (float)var1.getHeight()) + 0.5D);
      } else {
         return this.getPlacement() == 0 ? this.N().h().g() : this.c(0, 0, this.getUpperLeftRow(), this.getTop());
      }
   }

   public void setTopToCorner(int value) {
      if (!this.P() && !this.S()) {
         int var2 = this.getPlacement();
         this.setPlacement(0);
         this.N().h().c(value);
         this.setPlacement(var2);
      }
   }

   public int getLeftToCorner() {
      if (this.P()) {
         return 0;
      } else if (this.S()) {
         GroupShape var1 = this.getGroup();
         return (int)((double)((float)var1.getLeftToCorner() + (float)this.getLeftInShape() / 4000.0F * (float)var1.getWidth()) + 0.5D);
      } else {
         return this.getPlacement() == 0 ? this.N().h().j() : this.d(0, 0, this.getUpperLeftColumn(), this.getLeft());
      }
   }

   public void setLeftToCorner(int value) {
      if (!this.P() && !this.S()) {
         int var2 = this.getPlacement();
         this.setPlacement(0);
         this.N().h().e(value);
         this.setPlacement(var2);
      }
   }

   public int getX() {
      return this.getLeftToCorner();
   }

   public void setX(int value) {
      this.setLeftToCorner(value);
   }

   public int getY() {
      return this.getTopToCorner();
   }

   public void setY(int value) {
      this.setTopToCorner(value);
   }

   public int getWidthScale() {
      if (this.getMsoDrawingType() == 8) {
         Picture var1 = (Picture)this;
         zcb var2 = var1.a();
         return var2 == null ? 100 : (int)((double)(this.getWidth() * 100 / var2.k()) + 0.5D);
      } else {
         return 100;
      }
   }

   public void setWidthScale(int value) {
      if (this.S()) {
         this.N().h().i((int)((double)((float)(this.N().h().p() * value) / 100.0F) + 0.5D));
      } else {
         if (this.getMsoDrawingType() == 8) {
            Picture var2 = (Picture)this;
            zcb var3 = var2.a();
            if (var3 != null) {
               int var4 = (int)((double)((float)(var3.k() * value) / 100.0F) + 0.5D);
               this.setWidth(var4);
            }
         } else {
            int var5 = (int)((double)((float)(this.getWidth() * value) / 100.0F) + 0.5D);
            this.setWidth(var5);
         }

      }
   }

   public int getHeightScale() {
      if (this.getMsoDrawingType() == 8) {
         Picture var1 = (Picture)this;
         zcb var2 = var1.a();
         return var2 == null ? 100 : (int)((double)(this.getHeight() * 100 / var2.l()) + 0.5D);
      } else {
         return 100;
      }
   }

   public void setHeightScale(int value) {
      if (value <= 0) {
         throw new IllegalArgumentException("Invalid width scale: it must be greater than 0.");
      } else if (this.S()) {
         this.N().h().g(this.N().h().m() * value / 100);
      } else {
         if (this.getMsoDrawingType() == 8) {
            Picture var2 = (Picture)this;
            zcb var3 = var2.a();
            if (var3 != null) {
               int var4 = (int)((double)((float)(var3.l() * value) / 100.0F) + 0.5D);
               this.setHeight(var4);
            }
         } else {
            int var5 = (int)((double)((float)(this.getHeight() * value) / 100.0F) + 0.5D);
            this.setHeight(var5);
         }

      }
   }

   public int getTopInShape() {
      return !this.P() && !this.S() ? 0 : this.N().h().g();
   }

   public void setTopInShape(int value) {
      if (this.P() || this.S()) {
         if (value < 0 || value > 4000) {
            throw new IllegalArgumentException("Invalid TopInShape value : it must be between 0 and 4000.");
         }

         if (this.getPlacement() == 2) {
            int var2 = this.N().h().m() - this.N().h().g();
            this.N().h().c(value);
            this.N().h().g(value + var2);
         } else {
            this.N().h().c(value);
         }
      }

   }

   public int getLeftInShape() {
      return !this.P() && !this.S() ? 0 : this.N().h().j();
   }

   public void setLeftInShape(int value) {
      if (this.P() || this.S()) {
         if (value < 0 || value > 4000) {
            throw new IllegalArgumentException("Invalid TopInShape value : it must be between 0 and 4000.");
         }

         if (this.getPlacement() == 2) {
            int var2 = this.N().h().p() - this.N().h().j();
            this.N().h().e(value);
            this.N().h().i(var2 + value);
         } else {
            this.N().h().e(value);
         }
      }

   }

   public int getWidthInShape() {
      if (this.S()) {
         return this.N().h().p();
      } else if (this.P()) {
         if (this.getPlacement() == 1) {
            Chart var1 = (Chart)this.J().h();
            int var2 = (int)((double)((float)this.N().h().p() * 4000.0F / (float)var1.getChartObject().getWidth()) + 0.5D);
            return var2 > 4000 ? 4000 : var2;
         } else {
            return this.N().h().p() - this.N().h().j();
         }
      } else {
         return 0;
      }
   }

   public void setWidthInShape(int value) {
      if (value >= 0 && value <= 4000) {
         if (this.S()) {
            this.N().h().i(value);
         }

         if (this.P()) {
            if (this.getPlacement() == 1) {
               Chart var2 = (Chart)this.J().h();
               this.N().h().i((int)((double)((float)(value * var2.getChartObject().getWidth()) / 4000.0F) + 0.5D));
            } else {
               this.N().h().i(value + this.N().h().j());
            }
         }

      } else {
         throw new IllegalArgumentException("Invalid TopInShape value : it must be between 0 and 4000.");
      }
   }

   public int getHeightInShape() {
      if (this.S()) {
         return this.N().h().m();
      } else if (this.P()) {
         if (this.getPlacement() == 1) {
            Chart var1 = (Chart)this.J().h();
            int var2 = (int)((double)((float)this.N().h().m() * 4000.0F / (float)var1.getChartObject().getHeight()) + 0.5D);
            return var2 > 4000 ? 4000 : var2;
         } else {
            return this.N().h().m() - this.N().h().g();
         }
      } else {
         return 0;
      }
   }

   public void setHeightInShape(int value) {
      if (value >= 0 && value <= 4000) {
         if (this.S()) {
            this.N().h().g(value);
         }

         if (this.P()) {
            if (this.getPlacement() == 1) {
               Chart var2 = (Chart)this.J().h();
               int var3 = (int)((double)((float)value * 4000.0F / (float)var2.getChartObject().getHeight()) + 0.5D);
               this.N().h().g(var3);
            } else {
               this.N().h().g(value + this.N().h().g());
            }
         }

      } else {
         throw new IllegalArgumentException("Invalid TopInShape value : it must be between 0 and 4000.");
      }
   }

   /** @deprecated */
   public int getHeightInChart() {
      return this.getHeightInShape();
   }

   /** @deprecated */
   public void setHeightInChart(int value) {
      this.setHeightInShape(value);
   }

   /** @deprecated */
   public int getLeftInChart() {
      return this.getLeftInShape();
   }

   /** @deprecated */
   public void setLeftInChart(int value) {
      this.setLeftInShape(value);
   }

   /** @deprecated */
   public int getTopInChart() {
      return this.getTopInShape();
   }

   /** @deprecated */
   public void setTopInChart(int value) {
      this.setTopInShape(value);
   }

   /** @deprecated */
   public int getWidthInChart() {
      return this.getWidthInShape();
   }

   /** @deprecated */
   public void setWidthInChart(int value) {
      this.setWidthInShape(value);
   }

   /** @deprecated */
   public int getPositionX() {
      return this.getX();
   }

   /** @deprecated */
   public void setPositionX(int value) {
      this.setX(value);
   }

   /** @deprecated */
   public int getPositionY() {
      return this.getY();
   }

   /** @deprecated */
   public void setPositionY(int value) {
      this.setY(value);
   }

   public GroupShape getGroup() {
      return this.S() ? (GroupShape)this.n : null;
   }

   public int getType() {
      return this.getAutoShapeType();
   }

   public boolean hasLine() {
      return this.getLineFormat().isVisible();
   }

   public void setHasLine(boolean value) {
      this.getLineFormat().setVisible(value);
   }

   public boolean isFilled() {
      return this.getFillFormat().isVisible();
   }

   public void setFilled(boolean value) {
      this.getFillFormat().setVisible(value);
   }

   public boolean isFlippedHorizontally() {
      return this.N().i().e();
   }

   public void setFlippedHorizontally(boolean value) {
      this.N().i().f(value);
   }

   public boolean isFlippedVertically() {
      return this.N().i().d();
   }

   public void setFlippedVertically(boolean value) {
      this.N().i().e(value);
   }

   int[] a(int var1, int var2, int var3) {
      zahs var4 = this.M().getCells().getRows().b;
      if (var2 != 0) {
         int var5 = var4.a(var1);
         if (var3 < 0) {
            if (var2 >= var5) {
               var2 = var5;
            }

            var2 += var3;
            if (var2 >= 0) {
               return new int[]{var1, var2};
            }

            var3 = var2;
            --var1;
            if (var1 < 0) {
               return new int[]{0, 0};
            }
         } else {
            if (var2 < var5) {
               var5 -= var2;
               if (var5 > var3) {
                  return new int[]{var1, var2 + var3};
               }

               var3 -= var5;
            }

            ++var1;
         }

         var2 = 0;
      }

      if (var3 == 0) {
         return new int[]{var1, var2};
      } else {
         int[] var6 = new int[]{var1, var2, var3};
         var4.a(var6);
         return var3 > 0 && var6[2] == 0 ? new int[]{var6[0] + 1, 0} : new int[]{var6[0], var6[1]};
      }
   }

   double[] a(int var1, double var2, double var4) {
      zahs var6 = this.M().getCells().getRows().b;
      int var7;
      if (var2 != 0.0D) {
         var7 = var6.a(var1);
         if (var4 < 0.0D) {
            if (var2 >= (double)var7) {
               var2 = (double)var7;
            }

            var2 += var4;
            if (var2 >= 0.0D) {
               return new double[]{(double)var1, var2};
            }

            var4 = var2;
            --var1;
            if (var1 < 0) {
               return new double[]{0.0D, 0.0D};
            }
         } else {
            if (var2 < (double)var7) {
               var2 = (double)var7 - var2;
               if (var2 > var4) {
                  return new double[]{(double)var1, (double)var7 - var2 + var4};
               }

               var4 -= var2;
            }

            ++var1;
         }

         var2 = 0.0D;
      }

      if (var4 == 0.0D) {
         return new double[]{(double)var1, var2};
      } else {
         int[] var8;
         if (var4 < 0.0D) {
            var7 = -((int)Math.ceil(-var4));
            var8 = new int[]{var1, 0, var7};
            this.M().getCells().getRows().b.a(var8);
            return new double[]{(double)var8[0], (double)var8[1] - ((double)var7 - var4)};
         } else {
            var7 = (int)Math.ceil(var4);
            var8 = new int[]{var1, 0, var7};
            this.M().getCells().getRows().b.a(var8);
            return var8[2] == 0 && var4 == (double)var7 ? new double[]{(double)(var8[0] + 1), 0.0D} : new double[]{(double)var8[0], (double)var8[1] - ((double)var7 - var4)};
         }
      }
   }

   int c(int var1, int var2, int var3, int var4) {
      if (var1 > var3) {
         return 0;
      } else {
         zahs var5 = this.M().getCells().getRows().b;
         int var6 = var5.a(var1);
         if (var3 == var1) {
            if (var2 < var6) {
               if (var4 > var6) {
                  return var6 - var2;
               }

               if (var4 > var2) {
                  return var4 - var2;
               }
            }

            return 0;
         } else {
            if (var2 >= var6) {
               var2 = 0;
            } else {
               var2 = var6 - var2;
            }

            ++var1;
            var6 = var5.a(var3);
            if (var4 > var6) {
               var4 = var6;
            }

            return var1 == var3 ? var2 + var4 : var5.a(var1, var3 - 1) + var2 + var4;
         }
      }
   }

   double a(int var1, double var2, int var4, double var5) {
      if (var1 > var4) {
         return 0.0D;
      } else {
         zahs var7 = this.M().getCells().getRows().b;
         int var8 = var7.a(var1);
         if (var4 == var1) {
            if (var2 < (double)var8) {
               if (var5 > (double)var8) {
                  return (double)var8 - var2;
               }

               if (var5 > var2) {
                  return var5 - var2;
               }
            }

            return 0.0D;
         } else {
            if (var2 >= (double)var8) {
               var2 = 0.0D;
            } else {
               var2 = (double)var8 - var2;
            }

            ++var1;
            var8 = var7.a(var4);
            if (var5 > (double)var8) {
               var5 = (double)var8;
            }

            return var1 == var4 ? var2 + var5 : (double)var7.a(var1, var4 - 1) + var2 + var5;
         }
      }
   }

   int d(int var1, int var2, int var3, int var4) {
      if (var3 < var1) {
         return 0;
      } else {
         zagg var5 = this.M().getCells().c;
         int var6 = var5.a(var1);
         if (var3 == var1) {
            if (var2 < var6) {
               if (var4 > var6) {
                  return var6 - var2;
               }

               if (var4 > var2) {
                  return var4 - var2;
               }
            }

            return 0;
         } else {
            if (var2 >= var6) {
               var2 = 0;
            } else {
               var2 = var6 - var2;
            }

            ++var1;
            var6 = var5.a(var3);
            if (var4 > var6) {
               var4 = var6;
            }

            return var1 == var3 ? var2 + var4 : var5.b(var1, var3 - 1) + var2 + var4;
         }
      }
   }

   double b(int var1, double var2, int var4, double var5) {
      if (var4 < var1) {
         return 0.0D;
      } else {
         zagg var7 = this.M().getCells().c;
         int var8 = var7.a(var1);
         if (var4 == var1) {
            if (var2 < (double)var8) {
               if (var5 > (double)var8) {
                  return (double)var8 - var2;
               }

               if (var5 > var2) {
                  return var5 - var2;
               }
            }

            return 0.0D;
         } else {
            if (var2 >= (double)var8) {
               var2 = 0.0D;
            } else {
               var2 = (double)var8 - var2;
            }

            ++var1;
            var8 = var7.a(var4);
            if (var5 > (double)var8) {
               var5 = (double)var8;
            }

            return var1 == var4 ? var2 + var5 : (double)var7.b(var1, var4 - 1) + var2 + var5;
         }
      }
   }

   int[] b(int var1, int var2, int var3) {
      zagg var4 = this.M().getCells().c;
      if (var2 != 0) {
         int var5 = var4.a(var1);
         if (var3 < 0) {
            if (var2 >= var5) {
               var2 = var5;
            }

            var2 += var3;
            if (var2 >= 0) {
               return new int[]{var1, var2};
            }

            var3 = var2;
            --var1;
            if (var1 < 0) {
               return new int[]{0, 0};
            }
         } else {
            if (var2 < var5) {
               var5 -= var2;
               if (var5 > var3) {
                  return new int[]{var1, var2 + var3};
               }

               var3 -= var5;
            }

            ++var1;
         }

         var2 = 0;
      }

      if (var3 == 0) {
         return new int[]{var1, var2};
      } else {
         int[] var6 = new int[]{var1, var2, var3};
         var4.a(var6);
         return var3 > 0 && var6[2] == 0 ? new int[]{var6[0] + 1, 0} : new int[]{var6[0], var6[1]};
      }
   }

   double[] b(int var1, double var2, double var4) {
      zagg var6 = this.M().getCells().c;
      int var7;
      if (var2 != 0.0D) {
         var7 = var6.a(var1);
         if (var4 < 0.0D) {
            if (var2 >= (double)var7) {
               var2 = (double)var7;
            }

            var2 += var4;
            if (var2 >= 0.0D) {
               return new double[]{(double)var1, var2};
            }

            var4 = var2;
            --var1;
            if (var1 < 0) {
               return new double[]{0.0D, 0.0D};
            }
         } else {
            if (var2 < (double)var7) {
               var2 = (double)var7 - var2;
               if (var2 > var4) {
                  return new double[]{(double)var1, (double)var7 - var2 + var4};
               }

               var4 -= var2;
            }

            ++var1;
         }

         var2 = 0.0D;
      }

      if (var4 == 0.0D) {
         return new double[]{(double)var1, var2};
      } else {
         int[] var8;
         if (var4 < 0.0D) {
            var7 = -((int)Math.ceil(-var4));
            var8 = new int[]{var1, 0, var7};
            this.M().getCells().c.a(var8);
            return new double[]{(double)var8[0], (double)var8[1] - ((double)var7 - var4)};
         } else {
            var7 = (int)Math.ceil(var4);
            var8 = new int[]{var1, 0, var7};
            this.M().getCells().c.a(var8);
            return var8[2] == 0 && var4 == (double)var7 ? new double[]{(double)(var8[0] + 1), 0.0D} : new double[]{(double)var8[0], (double)var8[1] - ((double)var7 - var4)};
         }
      }
   }

   int a(int var1, double var2) {
      double var4 = (double)this.M().getCells().c(var1);
      var4 = (double)((int)(var2 / var4 * zjx.a + 0.5D));
      return (int)(var4 > zjx.a ? zjx.a : var4);
   }

   int b(int var1, double var2) {
      double var4 = (double)this.M().getCells().b(var1);
      var4 = (double)((int)(var2 / var4 * zjx.b + 0.5D));
      return (int)(var4 > zjx.b ? zjx.b : var4);
   }

   double a(int var1, int var2) {
      double var3 = (double)this.M().getCells().c(var1);
      return (double)var2 >= zjx.a ? var3 : (double)var2 * var3 / zjx.a;
   }

   double b(int var1, int var2) {
      double var3 = (double)this.M().getCells().b(var1);
      return (double)var2 >= zjx.b ? var3 : (double)var2 * var3 / zjx.b;
   }

   private int e(double var1) {
      return (int)(var1 * (double)this.L().L() + 0.5D);
   }

   double b(double var1) {
      return var1 / (double)this.L().L();
   }

   private int f(double var1) {
      return (int)(var1 * (double)this.L().L() / 2.5399999618530273D + 0.5D);
   }

   double h(int var1) {
      return (double)var1 * 2.5399999618530273D / (double)this.L().L();
   }

   private boolean b() {
      return this.getMsoDrawingType() == 5 && this == this.M().getCharts().get(0).getChartObject() && this.M().getType() == 2;
   }

   int a(byte[] var1, int var2, zbol var3) {
      var1[var2 + 2] = 15;
      var1[var2 + 3] = -16;
      var1[var2 + 4] = 16;
      var2 += 8;
      int var4 = var3.a + (int)((double)((float)var3.b * ((float)this.N().h().j() / 4000.0F)) + 0.5D);
      System.arraycopy(com.aspose.cells.b.a.zc.a(var4), 0, var1, var2, 4);
      var2 += 4;
      int var5 = var3.c + (int)((double)((float)var3.d * ((float)this.N().h().g() / 4000.0F)) + 0.5D);
      System.arraycopy(com.aspose.cells.b.a.zc.a(var5), 0, var1, var2, 4);
      var2 += 4;
      boolean var6 = false;
      int var7 = (int)((double)((float)var3.b * ((float)this.N().h().p() / 4000.0F)) + 0.5D) + var4;
      System.arraycopy(com.aspose.cells.b.a.zc.a(var7), 0, var1, var2, 4);
      var2 += 4;
      var7 = (int)((double)((float)var3.d * ((float)this.N().h().m() / 4000.0F)) + 0.5D) + var5;
      System.arraycopy(com.aspose.cells.b.a.zc.a(var7), 0, var1, var2, 4);
      var2 += 4;
      var1[var2 + 2] = 17;
      var1[var2 + 3] = -16;
      var2 += 8;
      return 32;
   }

   int a(byte[] var1, int var2) {
      var1[var2 + 2] = 16;
      var1[var2 + 3] = -16;
      var1[var2 + 4] = 18;
      var2 += 8;
      switch(this.N().h().e()) {
      case 0:
         var1[var2] = 3;
         break;
      case 1:
         var1[var2] = 2;
         break;
      default:
         if (this.N().h().b()) {
            var1[var2] = 1;
         }
      }

      zjx var3 = new zjx(this.N());
      var3.a(this.N().h());
      this.setPlacement(2);
      var2 += 2;
      if (this.P()) {
         int[] var4 = this.d(false);
         System.arraycopy(com.aspose.cells.b.a.zc.a(var4[0]), 0, var1, var2, 4);
         var2 += 4;
         System.arraycopy(com.aspose.cells.b.a.zc.a(var4[1]), 0, var1, var2, 4);
         var2 += 4;
         System.arraycopy(com.aspose.cells.b.a.zc.a(var4[2]), 0, var1, var2, 4);
         var2 += 4;
         System.arraycopy(com.aspose.cells.b.a.zc.a(var4[3]), 0, var1, var2, 4);
         var2 += 4;
      } else {
         var2 = this.b(var1, var2);
      }

      this.N().h().a(var3);
      var1[var2 + 2] = 17;
      var1[var2 + 3] = -16;
      var2 += 8;
      return 34;
   }

   int b(byte[] var1, int var2) {
      int var3 = this.N().h().i();
      int var4 = this.getUpperDeltaX();
      if (var3 > 255) {
         var1[var2] = -1;
         var1[var2 + 1] = 0;
         var1[var2 + 2] = 0;
         var1[var2 + 3] = 4;
      } else {
         System.arraycopy(com.aspose.cells.b.a.zc.a(var3), 0, var1, var2, 2);
         System.arraycopy(com.aspose.cells.b.a.zc.a(var4), 0, var1, var2 + 2, 2);
      }

      var2 += 4;
      int var5 = this.N().h().f();
      int var6 = this.getUpperDeltaY();
      if (var5 > 65535) {
         var1[var2] = -1;
         var1[var2 + 1] = -1;
         var1[var2 + 2] = 0;
         var1[var2 + 3] = 1;
      } else {
         System.arraycopy(com.aspose.cells.b.a.zc.a(var5), 0, var1, var2, 2);
         System.arraycopy(com.aspose.cells.b.a.zc.a(var6), 0, var1, var2 + 2, 2);
      }

      var2 += 4;
      int var7 = this.N().h().o();
      int var8 = this.getLowerDeltaX();
      if (var7 > 255) {
         var1[var2] = -1;
         var1[var2 + 1] = 0;
         var1[var2 + 2] = 0;
         var1[var2 + 3] = 4;
      } else {
         System.arraycopy(com.aspose.cells.b.a.zc.a(var7), 0, var1, var2, 2);
         System.arraycopy(com.aspose.cells.b.a.zc.a(var8), 0, var1, var2 + 2, 2);
      }

      var2 += 4;
      int var9 = this.N().h().l();
      int var10 = this.getLowerDeltaY();
      if (var9 > 65535) {
         var1[var2] = -1;
         var1[var2 + 1] = -1;
         var1[var2 + 2] = 0;
         var1[var2 + 3] = 1;
      } else {
         System.arraycopy(com.aspose.cells.b.a.zc.a(var9), 0, var1, var2, 2);
         System.arraycopy(com.aspose.cells.b.a.zc.a(var10), 0, var1, var2 + 2, 2);
      }

      var2 += 4;
      return var2;
   }

   GroupBox getGroupBox() {
      int var1 = this.getPlacement();
      this.setPlacement(2);
      int var2 = this.getUpperLeftRow();
      int var3 = this.getTop();
      int var4 = this.getUpperLeftColumn();
      int var5 = this.getLeft();
      int var6 = this.getLowerRightRow();
      int var7 = this.getBottom();
      int var8 = this.getLowerRightColumn();
      int var9 = this.getRight();
      this.setPlacement(var1);
      int var10 = -1;
      int var11 = -1;
      int var12 = -1;
      int var13 = -1;
      Iterator var14 = this.J().iterator();

      Shape var15;
      int var22;
      int var23;
      do {
         do {
            int var20;
            int var21;
            do {
               label57:
               do {
                  while(true) {
                     do {
                        if (!var14.hasNext()) {
                           return null;
                        }

                        var15 = (Shape)var14.next();
                     } while(var15.getMsoDrawingType() != 19);

                     switch(var15.getPlacement()) {
                     case 0:
                        if (var10 == -1) {
                           var10 = this.getTopToCorner();
                           var11 = this.getLeftToCorner();
                           var12 = var11 + this.getWidth();
                           var13 = var10 + this.getHeight();
                        }

                        int var16 = var15.getTopToCorner();
                        int var17 = var15.getLeftToCorner();
                        int var18 = var17 + var15.getWidth();
                        int var19 = var16 + var15.getHeight();
                        if (var10 >= var16 && var13 <= var19 && var11 >= var17 && var12 <= var18) {
                           return (GroupBox)var15;
                        }
                        break;
                     case 1:
                     case 2:
                        var20 = var15.getUpperLeftRow();
                        var10 = var15.getTop();
                        var21 = var15.getUpperLeftColumn();
                        var11 = var15.getLeft();
                        continue label57;
                     }
                  }
               } while(var2 <= var20 && (var2 != var20 || var3 < var10));
            } while(var4 <= var21 && (var4 != var21 || var5 < var11));

            var1 = var15.getPlacement();
            var15.setPlacement(2);
            var22 = var15.getLowerRightRow();
            var13 = var15.getBottom();
            var23 = var15.getLowerRightColumn();
            var12 = var15.getRight();
            var15.setPlacement(var1);
         } while(var6 >= var22 && (var6 != var22 || var7 > var13));
      } while(var8 >= var23 && (var8 != var23 || var9 > var12));

      return (GroupBox)var15;
   }

   public void toImage(OutputStream stream, ImageFormat imageFormat) throws Exception {
      ImageOrPrintOptions var3 = new ImageOrPrintOptions();
      var3.setImageFormat(imageFormat);
      this.toImage(stream, var3);
   }

   void a(com.aspose.cells.b.a.d.zm var1, ImageFormat var2) throws Exception {
      ImageOrPrintOptions var3 = new ImageOrPrintOptions();
      var3.setImageFormat(var2);
      this.a(var1, var3);
   }

   public void toImage(String imageFile, ImageOrPrintOptions options) throws Exception {
      if (options == null) {
         options = new ImageOrPrintOptions();
      }

      String var3 = com.aspose.cells.b.a.d.zk.d(imageFile);
      var3 = var3.toLowerCase();
      if (".svg".equals(var3)) {
         options.setSaveFormat(22);
      }

      if (".xps".equals(var3)) {
         options.setSaveFormat(20);
      } else {
         ImageFormat var4 = zbuk.a(var3, options.getImageFormat());
         options.setImageFormat(var4);
      }

      com.aspose.cells.b.a.d.ze var8 = new com.aspose.cells.b.a.d.ze(imageFile, 2);

      try {
         this.a((com.aspose.cells.b.a.d.zm)var8, (ImageOrPrintOptions)options);
      } finally {
         if (var8 != null) {
            var8.a();
         }

      }

   }

   public void toImage(OutputStream stream, ImageOrPrintOptions options) throws Exception {
      com.aspose.cells.b.a.d.zh var3 = new com.aspose.cells.b.a.d.zh();

      try {
         this.a((com.aspose.cells.b.a.d.zm)var3, (ImageOrPrintOptions)options);
         var3.a(0L, 0);
         var3.a(stream);
      } finally {
         if (var3 != null) {
            var3.a();
         }

      }

   }

   void a(com.aspose.cells.b.a.d.zm var1, ImageOrPrintOptions var2) throws Exception {
      if (var2 == null) {
         var2 = new ImageOrPrintOptions();
      }

      if (var2.getSaveFormat() == 22) {
         this.b(var1, var2);
      } else if (var2.getSaveFormat() == 20) {
         this.c(var1, var2);
      } else if (this.L().n().j()) {
         zbma.a(var1, var2, this);
      } else {
         zblz.a(var1, var2, this);
      }

   }

   private void b(com.aspose.cells.b.a.d.zm var1, ImageOrPrintOptions var2) throws Exception {
      com.aspose.cells.b.a.d.zh var3 = new com.aspose.cells.b.a.d.zh();

      try {
         ImageOrPrintOptions var4 = new ImageOrPrintOptions();
         var4.setImageFormat(ImageFormat.getEmf());
         this.a((com.aspose.cells.b.a.d.zm)var3, (ImageOrPrintOptions)var4);
         var3.a(0L, 0);
         com.aspose.cells.a.d.zfp var5 = new com.aspose.cells.a.d.zfp(var2);
         var5.e = ImageFormat.getEmf();
         com.aspose.cells.b.a.b.zt var6 = new com.aspose.cells.b.a.b.zt((float)this.getWidthPt(), (float)this.getHeightPt());
         com.aspose.cells.a.d.zm var7 = new com.aspose.cells.a.d.zm(var6.b(), var6.c());
         com.aspose.cells.a.d.zb var8 = new com.aspose.cells.a.d.zb();
         com.aspose.cells.a.d.zj var9 = com.aspose.cells.a.d.zj.a(new com.aspose.cells.b.a.b.zo(0.0F, 0.0F), var6, var3);
         var8.a((com.aspose.cells.a.d.zl)var9);
         var7.a(var8);
         var5.a(var7, var1, var2.getEmbededImageNameInSvg());
         var5.a();
      } finally {
         if (var3 != null) {
            var3.a();
         }

      }

   }

   private void c(com.aspose.cells.b.a.d.zm var1, ImageOrPrintOptions var2) throws Exception {
      com.aspose.cells.b.a.d.zh var3 = new com.aspose.cells.b.a.d.zh();

      try {
         ImageOrPrintOptions var4 = new ImageOrPrintOptions();
         var4.setImageFormat(ImageFormat.getEmf());
         this.a((com.aspose.cells.b.a.d.zm)var3, (ImageOrPrintOptions)var4);
         var3.a(0L, 0);
         com.aspose.cells.a.d.zgp var5 = new com.aspose.cells.a.d.zgp(var1);
         var5.e = ImageFormat.getEmf();
         com.aspose.cells.b.a.b.zt var6 = new com.aspose.cells.b.a.b.zt((float)this.getWidthPt(), (float)this.getHeightPt());
         com.aspose.cells.a.d.zm var7 = new com.aspose.cells.a.d.zm(var6.b(), var6.c());
         com.aspose.cells.a.d.zb var8 = new com.aspose.cells.a.d.zb();
         com.aspose.cells.a.d.zj var9 = com.aspose.cells.a.d.zj.a(new com.aspose.cells.b.a.b.zo(0.0F, 0.0F), var6, var3);
         var8.a((com.aspose.cells.a.d.zl)var9);
         var7.a(var8);
         var5.a((com.aspose.cells.a.d.zl)var7);
         var5.a();
      } finally {
         if (var3 != null) {
            var3.a();
         }

      }

   }

   com.aspose.cells.b.a.b.zq W() throws Exception {
      if (!this.r) {
         if (this.L().n().j()) {
            this.d = zbma.a(this);
         } else {
            this.d = zblz.a(this);
         }

         this.r = true;
      }

      return this.d;
   }

   public boolean getRelativeToOriginalPictureSize() {
      return this.N().c().a(831, 4, true);
   }

   public void setRelativeToOriginalPictureSize(boolean value) {
      this.N().c().b(831, 4, value);
   }

   byte[] X() {
      return this.u;
   }

   void c(byte[] var1) {
      this.u = var1;
   }

   Cell e(boolean var1) {
      if (this.u != null) {
         Range var2 = this.d(this.u);
         if (var2 != null) {
            if (var1) {
               return var2.get(0, 0);
            }

            return var2.getCellOrNull(0, 0);
         }
      }

      return null;
   }

   Range d(byte[] var1) {
      CalculationOptions var2 = new CalculationOptions();
      var2.h = false;
      var2.b = true;
      zaay var3 = new zaay(this.M(), 3, var2);
      var3.a = 3;
      var3.f = this;
      zagu var4 = (new zyg(var3, var1, 0, var1.length)).a();
      var4 = zaaq.b(var4, var3);
      return var4.b() == 9 ? ((zaal)var4).k().b(var3) : null;
   }

   public String getLinkedCell() {
      if (this.u == null) {
         return null;
      } else {
         String var1 = this.L().b().a(0, this.u.length, this.u, 0, 0, false);
         return var1 != null && !"".equals(var1) && var1.charAt(0) == '=' ? var1.substring(1) : var1;
      }
   }

   public void setLinkedCell(String value) {
      this.e(value);
   }

   void e(String var1) {
      if (var1 != null && !"".equals(var1)) {
         boolean var2 = false;
         boolean[] var3 = new boolean[]{var2};
         byte[] var4 = zyp.a(this.L(), this.M().getIndex(), var1, false, true, false, var3);
         var2 = var3[0];
         if (var2) {
            this.u = var4;
         } else {
            int[] var5 = this.L().getNames().a(this.M().getIndex(), var1, false, false);
            int var6 = var5[1];
            if (var6 != -1) {
               var4 = new byte[5];
               var4[0] = 35;
               System.arraycopy(com.aspose.cells.b.a.zc.a(var6 + 1), 0, var4, 1, 2);
               this.u = var4;
            } else {
               this.u = null;
            }
         }

         if (this.getMsoDrawingType() == 20) {
            ComboBox var7 = (ComboBox)this;
            var7.a = null;
         }

      } else {
         this.u = null;
      }
   }

   Range Y() {
      return this.d(this.v);
   }

   public String getInputRange() {
      if (this.v == null) {
         return null;
      } else {
         String var1 = this.L().b().a(0, this.v.length, this.v, 0, 0, false);
         return var1 != null && !"".equals(var1) && var1.charAt(0) == '=' ? var1.substring(1) : var1;
      }
   }

   public void setInputRange(String value) {
      if (value != null && !"".equals(value)) {
         boolean var2 = false;

         try {
            boolean[] var3 = new boolean[]{var2};
            byte[] var4 = zyp.a(this.L(), this.M().getIndex(), value, false, true, false, var3);
            var2 = var3[0];
            if (var2) {
               this.v = var4;
            } else {
               int[] var5 = this.L().getNames().a(this.M().getIndex(), value, false, false);
               int var6 = var5[1];
               if (var6 != -1) {
                  var4 = new byte[5];
                  var4[0] = 35;
                  System.arraycopy(com.aspose.cells.b.a.zc.a(var6 + 1), 0, var4, 1, 2);
                  this.v = var4;
               } else {
                  this.v = null;
               }
            }
         } catch (Exception var7) {
            this.v = this.L().x().a(-1, "=" + value, 0, 0, 0, 32, false, false, false);
         }

         if (this instanceof ComboBox) {
            ((ComboBox)this).a = null;
         }

      } else {
         this.v = null;
      }
   }

   byte[] Z() {
      return this.v;
   }

   void e(byte[] var1) {
      this.v = var1;
   }

   public void updateSelectedValue() throws Exception {
      int var19;
      if (this.getMsoDrawingType() == 8) {
         if (this.e != null && !"".equals(this.e)) {
            Range var11 = this.L().getRangeByName(this.e);
            if (var11 == null) {
               try {
                  int var15 = this.e.lastIndexOf(33);
                  if (var15 != -1) {
                     String var3 = this.e.substring(0, 0 + var15);
                     int[] var13 = zyn.a(this.L(), var3);
                     if (var13[1] == this.L().u() && var13[2] < this.L().getCount() && var13[2] >= 0) {
                        var11 = this.L().get(var13[2]).getCells().createRange(this.e.substring(var15 + 1));
                     }
                  } else {
                     var11 = this.M().getCells().createRange(this.e);
                  }
               } catch (Exception var10) {
                  ;
               }
            }

            if (var11 != null) {
               Picture var17 = (Picture)this;
               ImageFormat var12 = var17.getImageFormat();
               var17.setData((byte[])null);
               Worksheet var14 = var11.getWorksheet();
               var19 = var14.getVisibilityType();
               var14.setVisibilityType(0);
               String var24 = var14.getPageSetup().getPrintArea();
               var14.getPageSetup().setPrintArea(var11.b());
               ImageOrPrintOptions var27 = new ImageOrPrintOptions();
               var27.setOnlyArea(true);
               var27.setOnePagePerSheet(true);
               var27.setImageFormat(var12);
               SheetRender var25 = new SheetRender(var14, var27);
               com.aspose.cells.b.a.d.zh var26 = new com.aspose.cells.b.a.d.zh();
               var25.a(0, var26);
               if (var26.h() > 0L) {
                  var17.setData(var26.o());
               }

               var26.a();
               var11.getWorksheet().getPageSetup().setPrintArea(var24);
               var14.setVisibilityType(var19);
            }
         }

      } else {
         Cell var1 = this.e(false);
         if (var1 != null) {
            double var2 = 0.0D;
            String var4 = var1.j();
            switch(var1.getType()) {
            case 0:
               var2 = var1.getBoolValue() ? 1.0D : 0.0D;
               break;
            case 1:
            case 4:
               var2 = Math.floor(var1.getDoubleValue());
               if (var2 < 0.0D) {
                  var2 = 0.0D;
               }
            case 2:
            case 3:
            }

            int var6;
            int var7;
            switch(this.getMsoDrawingType()) {
            case 2:
            case 6:
               this.aa().a(var4);
            case 3:
            case 4:
            case 5:
            case 7:
            case 8:
            case 9:
            case 10:
            case 13:
            case 14:
            case 15:
            case 19:
            default:
               break;
            case 11:
               switch(var1.getType()) {
               case 0:
                  boolean var20 = var1.getBoolValue();
                  ((CheckBox)this).a(var20 ? 1 : 0);
                  return;
               case 1:
               case 4:
                  var2 = Math.ceil(var1.getDoubleValue());
                  ((CheckBox)this).a(var2 != 0.0D ? 1 : 0);
                  return;
               case 2:
                  boolean var23 = "#N/A".equals(var1.j());
                  if (var23) {
                     ((CheckBox)this).a(2);
                  }

                  return;
               case 3:
               default:
                  return;
               }
            case 12:
               var19 = (int)(var2 - 1.0D);
               GroupBox var21 = this.getGroupBox();
               var7 = 0;
               if (var21 != null) {
                  ArrayList var8 = var21.a();

                  for(int var9 = 0; var9 < var8.size(); ++var9) {
                     if (((Shape)var8.get(var9)).getMsoDrawingType() == 12) {
                        if (var7 == var19) {
                           ((RadioButton)var8.get(var9)).a(true);
                        } else {
                           ((RadioButton)var8.get(var9)).a(false);
                        }

                        ++var7;
                     }
                  }

                  return;
               } else {
                  for(int var22 = 0; var22 < this.j.getCount(); ++var22) {
                     if (this.j.get(var22).getMsoDrawingType() == 12) {
                        var21 = this.j.get(var22).getGroupBox();
                        if (var21 == null) {
                           if (var7 == var19) {
                              ((RadioButton)this.j.get(var22)).a(true);
                           } else {
                              ((RadioButton)this.j.get(var22)).a(false);
                           }

                           ++var7;
                        }
                     }
                  }

                  return;
               }
            case 16:
               ((Spinner)this).a((int)var2);
               break;
            case 17:
               ScrollBar var18 = (ScrollBar)this;
               var6 = (int)var2;
               if (var6 > var18.getMax()) {
                  var6 = var18.getMax();
               } else if (var6 < var18.getMin()) {
                  var6 = var18.getMin();
               }

               ((ScrollBar)this).a(var6);
               break;
            case 18:
               ListBox var16 = (ListBox)this;
               var6 = var16.getItemCount();
               var7 = (int)(var2 - 1.0D);
               if (var7 >= var6) {
                  var7 = var6 - 1;
               }

               ((ListBox)this).a(var7);
               break;
            case 20:
               ComboBox var5 = (ComboBox)this;
               var6 = var5.b();
               var7 = (int)(var2 - 1.0D);
               if (var7 >= var6) {
                  var7 = var6 - 1;
               }

               var5.a(var7);
            }

         }
      }
   }

   void a(long var1) {
      if (this.g != null && this.g.k != null) {
         this.g.k.b(var1);
      }

   }

   zbtz aa() {
      if (this.w == null) {
         this.w = new zbtz(this);
      }

      return this.w;
   }

   zbtz ab() {
      return this.w;
   }

   public Font getFont() {
      return this.aa().k();
   }

   public void setFont(Font value) {
      this.aa().a(value);
   }

   public String getText() {
      return this.w == null ? null : this.aa().i();
   }

   public void setText(String value) {
      this.aa().a(value);
      switch(this.getMsoDrawingType()) {
      case 2:
      case 6:
         this.b(value);
      default:
      }
   }

   public boolean isRichText() {
      return this.w == null ? false : this.aa().q();
   }

   public String getHtmlText() throws Exception {
      return this.w == null ? null : this.aa().j();
   }

   public void setHtmlText(String value) {
      this.aa().b(value);
   }

   public void formatCharacters(int startIndex, int length, Font font) {
      if (startIndex == 0 && length == this.getText().length()) {
         this.setFont(font);
         if (this.aa().p() != null) {
            this.w.p().clear();
         }
      } else {
         FontSetting var4 = this.aa().a(startIndex, length);
         var4.a(font);
      }

   }

   public FontSetting characters(int startIndex, int length) {
      return this.aa().a(startIndex, length);
   }

   public ArrayList getCharacters() {
      return this.aa().p();
   }

   public int getTextVerticalOverflow() {
      return this.aa().b();
   }

   public void setTextVerticalOverflow(int value) {
      this.aa().b(value);
   }

   public int getTextHorizontalOverflow() {
      return this.aa().c();
   }

   public void setTextHorizontalOverflow(int value) {
      this.aa().c(value);
   }

   public boolean isTextWrapped() {
      return this.aa().d;
   }

   public void setTextWrapped(boolean value) {
      this.aa().d = value;
   }

   public int getTextOrientationType() {
      return this.aa().f();
   }

   public void setTextOrientationType(int value) {
      this.aa().d(value);
   }

   public int getTextHorizontalAlignment() {
      return this.aa().g();
   }

   public void setTextHorizontalAlignment(int value) {
      this.aa().e(value);
   }

   public int getTextVerticalAlignment() {
      return this.aa().h();
   }

   public void setTextVerticalAlignment(int value) {
      this.aa().f(value);
   }

   public int getTextDirection() {
      return this.aa().e;
   }

   public void setTextDirection(int value) {
      this.aa().e = value;
   }

   String ac() {
      return this.e;
   }

   void f(String var1) {
      this.e = var1;
   }

   public byte[] getControlData() throws Exception {
      return this.x != null ? this.x.a(this, this.L().n()) : null;
   }

   public ActiveXControl getActiveXControl() throws Exception {
      return this.x != null ? this.x.b(this, this.L().n()) : null;
   }

   boolean ad() {
      return this.ae() || !this.af();
   }

   boolean ae() {
      switch(this.getMsoDrawingType()) {
      case 8:
         if (this.ac() != null && this.ac().length() > 0) {
            return true;
         }
      default:
         return this.x != null;
      case 24:
         return true;
      }
   }

   boolean af() {
      if (this.g != null && this.g.a != null) {
         return true;
      } else {
         switch(this.getMsoDrawingType()) {
         case 0:
            Iterator var1 = ((GroupShape)this).d().iterator();

            Shape var2;
            do {
               if (!var1.hasNext()) {
                  return true;
               }

               var2 = (Shape)var1.next();
            } while(!var2.ad());

            return false;
         case 1:
         case 2:
         case 3:
         case 4:
         case 5:
         case 6:
         case 9:
         case 10:
         case 13:
         case 15:
         case 21:
         case 22:
         case 23:
         default:
            return false;
         case 7:
         case 11:
         case 12:
         case 14:
         case 16:
         case 17:
         case 18:
         case 19:
         case 24:
         case 25:
            return true;
         case 8:
            if (this.ac() != null && this.ac().length() > 0) {
               return true;
            } else {
               if (((Picture)this).b != null) {
                  return true;
               }

               return this.x != null;
            }
         case 20:
            return true;
         }
      }
   }

   public ShapePathCollection getPaths() {
      if (!this.ah()) {
         return null;
      } else {
         CustomGeometry var1 = (CustomGeometry)this.getGeometry();
         return var1.getPaths();
      }
   }

   Geometry ag() {
      return this.A;
   }

   void a(Geometry var1) {
      this.A = var1;
   }

   boolean ah() {
      if (this.A != null) {
         return this.A.a();
      } else {
         return this.getAutoShapeType() == 0 || this.k.k();
      }
   }

   public Geometry getGeometry() {
      if (this.A == null) {
         if (this.ah()) {
            this.A = new CustomGeometry(this);
         } else {
            this.A = new zavh(this);
         }
      }

      return this.A;
   }

   zacg ai() {
      return new zacg(this, this.N().c());
   }

   int[] c(double var1) {
      int[] var3 = new int[4];
      var1 %= 360.0D;
      if (var1 < 0.0D) {
         var1 += 360.0D;
      }

      byte var4 = 0;
      byte var5 = 0;
      if (this.N().h().k() - (double)((int)this.N().h().k()) < 0.5D && this.N().h().q() - (double)((int)this.N().h().q()) > 0.5D) {
         var4 = -1;
      }

      if (this.N().h().h() - (double)((int)this.N().h().h()) < 0.5D && this.N().h().n() - (double)((int)this.N().h().n()) > 0.5D) {
         var5 = -1;
      }

      int var6 = Math.abs(this.getWidth() - this.getHeight());
      if (this.getWidth() > this.getHeight()) {
         if ((var1 < 45.0D || var1 >= 135.0D) && (var1 < 225.0D || var1 >= 315.0D)) {
            var3[0] = this.getX();
            var3[1] = this.getY();
            var3[2] = this.getWidth() + var4;
            var3[3] = this.getHeight() + var5;
         } else {
            var3[0] = this.getX() + var6 / 2;
            var3[1] = this.getY() - var6 / 2;
            var3[2] = this.getHeight() + var5;
            var3[3] = this.getWidth() + var4;
         }
      } else if ((var1 < 45.0D || var1 >= 135.0D) && (var1 < 225.0D || var1 >= 315.0D)) {
         var3[0] = this.getX();
         var3[1] = this.getY();
         var3[2] = this.getWidth() + var4;
         var3[3] = this.getHeight() + var5;
      } else {
         var3[0] = this.getX() - var6 / 2;
         var3[1] = this.getY() + var6 / 2;
         var3[2] = this.getHeight() + var5;
         var3[3] = this.getWidth() + var4;
      }

      return var3;
   }

   int[] d(double var1) {
      int[] var3 = new int[4];
      if (var1 < 0.0D) {
         var1 += 360.0D;
      }

      int var4 = Math.abs(this.getWidth() - this.getHeight());
      if (this.getWidth() < this.getHeight()) {
         if ((var1 < 45.0D || var1 >= 135.0D) && (var1 < 225.0D || var1 >= 315.0D)) {
            var3[0] = this.getX();
            var3[1] = this.getY();
            var3[2] = this.getWidth();
            var3[3] = this.getHeight();
         } else {
            var3[0] = this.getX() - var4 / 2;
            var3[1] = this.getY() + var4 / 2;
            var3[2] = this.getHeight();
            var3[3] = this.getWidth();
         }
      } else if ((var1 < 45.0D || var1 >= 135.0D) && (var1 < 225.0D || var1 >= 315.0D)) {
         var3[0] = this.getX();
         var3[1] = this.getY();
         var3[2] = this.getWidth();
         var3[3] = this.getHeight();
      } else {
         var3[0] = this.getX() + var4 / 2;
         var3[1] = this.getY() - var4 / 2;
         var3[2] = this.getHeight();
         var3[3] = this.getWidth();
      }

      return var3;
   }

   public int getActualLowerRightRow() {
      int var1 = this.getLowerRightRow();
      if (this.getPlacement() == 2) {
         Cells var2 = this.M().getCells();
         if (var2.t()) {
            RowCollection var3 = var2.getRows();
            if (var3.getCount() == 0) {
               return 0;
            }

            for(int var4 = var3.getCount() - 1; var4 >= 0; --var4) {
               Row var5 = var3.getRowByIndex(var4);
               if (!var5.isHidden()) {
                  if (var1 > var5.getIndex()) {
                     var1 = var5.getIndex();
                  }
                  break;
               }
            }
         }
      }

      return var1;
   }

   public int[] calculateTextSize() throws Exception {
      return zbsy.a(this);
   }

   void a(int var1, int var2, Worksheet var3, boolean var4) {
      int var5;
      switch(this.getPlacement()) {
      case 0:
      default:
         break;
      case 1:
         var5 = this.getUpperLeftRow();
         if (var1 <= var5) {
            if (var2 < 0 && var1 - var2 > var5) {
               this.setLeft(0);
               var5 = var1;
            } else {
               var5 += var2;
            }

            if (var5 > 1048575) {
               throw new CellsException(13, "Can not shift object off the sheet.");
            }

            this.setUpperLeftRow(var5);
         }
         break;
      case 2:
         var5 = this.getUpperLeftRow();
         int var6 = this.getTop();
         int var7 = this.getLowerRightRow();
         int var8 = this.getBottom();
         if (var2 > 0) {
            if (var1 <= var5) {
               var5 += var2;
               var7 += var2;
               if (var5 <= 1048575 && var7 <= 1048575) {
                  this.N().h().b(var5);
                  this.N().h().f(var7);
                  return;
               }

               throw new CellsException(13, "Can not shift object off the sheet.");
            }

            if (var8 == 0) {
               --var7;
            }

            if (var1 <= var7) {
               var7 += var2;
               if (var8 == 0) {
                  ++var7;
               }

               this.N().h().f(var7);
            }

            return;
         }

         int var9 = var8 == 0 ? var7 - 1 : var7;
         int var10 = var1 - var2 - 1;
         if (var1 < var5) {
            if (var10 < var5) {
               var5 += var2;
               var7 += var2;
               this.N().h().b(var5);
               this.N().h().f(var7);
            } else if (var10 < var9) {
               this.N().h().c(0);
               var7 += var2;
               this.N().h().b(var1);
               this.N().h().f(var7);
            } else {
               this.N().h().b(var1);
               this.N().h().c(0);
               this.N().h().f(var1);
               this.N().h().g(0);
            }
         } else if (var1 <= var9) {
            if (var10 < var9) {
               this.N().h().f(var7 + var2);
            } else {
               this.N().h().f(var1);
               this.N().h().g(0);
            }
         }
      }

   }

   void b(int var1, int var2, Worksheet var3, boolean var4) {
      int var5;
      switch(this.getPlacement()) {
      case 0:
      default:
         break;
      case 1:
         var5 = this.getUpperLeftColumn();
         if (var1 <= var5) {
            if (var2 < 0 && var1 - var2 > var5) {
               this.setLeft(0);
               var5 = var1;
            } else {
               var5 += var2;
            }

            if (var5 > 16383) {
               throw new CellsException(10, "Can not shift object off the sheet.");
            }

            this.setUpperLeftColumn(var5);
         }
         break;
      case 2:
         var5 = this.getUpperLeftColumn();
         int var6 = this.getLeft();
         int var7 = this.getLowerRightColumn();
         int var8 = this.getRight();
         if (var2 > 0) {
            if (var1 <= var5) {
               var5 += var2;
               var7 += var2;
               if (var5 <= 16383 && var7 <= 16383) {
                  this.N().h().d(var5);
                  this.N().h().h(var7);
                  return;
               }

               throw new CellsException(10, "Aspose.Cells cannot shift nonblank cell off the worksheet.");
            }

            if (var8 == 0) {
               --var7;
            }

            if (var1 <= var7) {
               var7 += var2;
               if (var8 == 0) {
                  ++var7;
               }

               this.N().h().h(var7);
            }

            return;
         }

         int var9 = var8 == 0 ? var7 - 1 : var7;
         int var10 = var1 - var2 - 1;
         if (var1 < var5) {
            if (var10 < var5) {
               var5 += var2;
               var7 += var2;
               this.N().h().d(var5);
               this.N().h().h(var7);
            } else if (var10 < var9) {
               this.N().h().e(0);
               var7 += var2;
               this.N().h().d(var1);
               this.N().h().h(var7);
            } else {
               this.N().h().d(var1);
               this.N().h().e(0);
               this.N().h().h(var1);
               this.N().h().i(0);
            }
         } else if (var1 <= var9) {
            if (var10 < var9) {
               this.N().h().h(var7 + var2);
            } else {
               this.N().h().h(var1);
               this.N().h().i(0);
            }
         }
      }

   }

   void a(CellArea var1, int var2) {
      boolean var3 = false;
      boolean var4 = false;
      boolean var5 = false;
      int var6;
      int var7;
      int var8;
      switch(this.getPlacement()) {
      case 0:
      default:
         break;
      case 1:
         var7 = this.getUpperLeftColumn();
         var6 = this.getUpperLeftRow();
         var8 = this.getLowerRightRow();
         if (var7 >= var1.StartColumn && var1.StartRow <= var6 && var1.EndRow >= var8) {
            this.N().h().d(var7 + var2);
         }
         break;
      case 2:
         var7 = this.getUpperLeftColumn();
         var6 = this.getUpperLeftRow();
         var8 = this.getLowerRightRow();
         if (var1.StartRow <= var6 && var1.EndRow >= var8) {
            if (var7 >= var1.StartColumn) {
               this.N().h().d(this.N().h().i() + var2);
            } else if (var7 <= var1.EndColumn) {
               this.N().h().h(this.N().h().o() + var2);
            }
         }
      }

   }

   void b(CellArea var1, int var2) {
      boolean var3 = false;
      boolean var4 = false;
      boolean var5 = false;
      int var6;
      int var7;
      int var8;
      switch(this.getPlacement()) {
      case 0:
      default:
         break;
      case 1:
         var7 = this.getUpperLeftColumn();
         var8 = this.getLowerRightColumn();
         var6 = this.getUpperLeftRow();
         if (var1.StartColumn <= var7 && var1.EndColumn >= var8 && var6 <= var1.StartRow) {
            this.setUpperLeftRow(var6 + var2);
         }
         break;
      case 2:
         var7 = this.getUpperLeftColumn();
         var8 = this.getLowerRightColumn();
         var6 = this.getUpperLeftRow();
         if (var1.StartColumn <= var7 && var1.EndColumn >= var8) {
            if (var6 >= var1.StartRow) {
               this.N().h().b(this.N().h().f() + var2);
            } else if (var6 <= var1.EndRow) {
               this.N().h().f(this.N().h().l() + var2);
            }
         }
      }

   }

   void b(Object var1) {
      if (this.u != null) {
         Cell var2 = this.e(true);
         if (var2 != null) {
            var2.putValue(var1);
         }
      }

   }

   boolean aj() {
      return (this.B & 1) != 0;
   }

   void f(boolean var1) {
      this.B = (short)(this.B & -2);
      if (var1) {
         this.B = (short)(this.B | 1);
      }

   }

   boolean ak() {
      return (this.B & 2) != 0;
   }

   void g(boolean var1) {
      this.B = (short)(this.B & -3);
      if (var1) {
         this.B = (short)(this.B | 2);
      }

   }
}
